[TYPO3] help needed - captions splits??

JoH info at cybercraft.de
Mon May 8 23:47:29 CEST 2006


>>> Well - captionSplit has been removed in favor of a split function
>>> which is located directly in caption.
>
>   Dear Katja, Joey is wrong here. That split function simply doesn't
> exist in the static template "content (default)" of T3 4.0.

So why am I wrong then?
I just told her, that it doesn't exist and one has to implement something
similar oneself.
AFAIK the listNum function doesn't exist too in content(default) but it of
course it is working.
Reason: Since the whole caption object is able to use stdWrap functions you
can simply add the split _or_ listNum function there without any problems.

>   You can write this into your TS-Setup:
>
>   temp.myCaption = COA
>   temp.myCaption {
>   1.if.isTrue.field = imagecaption
>   1 = TEXT
>   1.field = imagecaption
>   1.listNum.splitChar = 10
>   1.listNum.stdWrap.data = register : IMAGE_NUM
>   1.parseFunc < styles.content.parseFunc
>   1.wrapAlign.field = imagecaption_position
>   1.wrap = |<br>
> }

And BTW:
She already used it and found out another problem, which is the same problem
like in your approach.
Due to the fact that the register IMAGE_NUM is set _after_ the first
rendering of the caption in content(default) you can't use it, since it will
give you twice a 0 in the beginning, thus leading to a double first caption
while skipping the last.
The only solution is to use a manually created register and calculate it
using prioriCalc like this:

tt_content.image.20 {
    caption {
        1 = TEXT
        1 {
            field = imagecaption
            required = 1
            parseFunc =< lib.parseFunc
            br = 1
            fontTag = <p class="csc-caption">|</p>
            wrapAlign.field = imagecaption_position
            split.token.char = 10
            split.returnKey.cObject = COA
            split.returnKey.cObject {
              10 = TEXT
              10.data = register:caption_counter
              20 = LOAD_REGISTER
              20.caption_counter.cObject = TEXT
              20.caption_counter.cObject.dataWrap =
{register:caption_counter}+1
              20.caption_counter.prioriCalc = intval
            }
        }
    }
    captionSplit = 1
    imgTextSplit = 1
}

or if you prefer listNum instead of split:

tt_content.image.20 {
    caption {
        1 = TEXT
        1 {
            field = imagecaption
            required = 1
            parseFunc =< lib.parseFunc
            br = 1
            fontTag = <p class="csc-caption">|</p>
            wrapAlign.field = imagecaption_position
            listNum.splitChar = 10
            listNum.stdWrap.cObject = COA
            listNum.stdWrap.cObject {
              10 = TEXT
              10.data = register:caption_counter
              20 = LOAD_REGISTER
              20.caption_counter.cObject = TEXT
              20.caption_counter.cObject.dataWrap =
{register:caption_counter}+1
              20.caption_counter.prioriCalc = intval
            }
        }
    }
    captionSplit = 1
    imgTextSplit = 1
}

you have clear the register in the beginning of each new content element:

tt_content.image.15 = LOAD_REGISTER
tt_content.image.15.caption_counter = 0

plus the copy for textpic:

tt_content.textpic.15 < tt_content.image.15
tt_content.textpic.20.caption < tt_content.image.20.caption

Both are tested and working!

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.cybercraft.de





More information about the TYPO3-english mailing list