[TYPO3-english] odd / even classes for every second record

JoH asenau info at cybercraft.de
Tue Jan 12 13:02:43 CET 2010


> Just and idea for another means of doing it -as we know that all the
> odd and even item will have predefined numbers you could just do this
> :
>
> temp.boxenelemente = CONTENT
> temp.boxenelemente {
>      table = tt_content
>      select {
>        where = colPos = 2
>        orderBy = sorting
>      }
> renderObj < tt_content
> renderObj.outerWrap = <div class="odd">|</div>
> renderObj.outerWrap.override = <div class="even">|</div>
> renderObj.outerWrap.override.if.value =
> 2,4,6,8,10,12,14,16,18,20,22,24,26,28,30
> renderObj.outerWrap.override.if.isInList.data =
> cObj:parentRecordNumber }

And another one, that is using optionSplit for the same purpose:

temp.elemente = COA
temp.elemente {
    10 = CONTENT
    10 {
        table = tt_content
        select {
            where = colPos = 2
            orderBy = sorting
        }
        renderObj < tt_content
        renderObj.wrap = |###SPLITTER###
    }
    stdWrap.split {
        token = ###SPLITTER###
        cObjNum = 1 |*| 2 || 3 |*| 4 || 5
        1.current = 1
        1.wrap = <div class="first">|</div>
        2.current = 1
        2.wrap = <div class="even">|</div>
        3.current = 1
        3.wrap = <div class="odd">|</div>
        4.current = 1
        4.wrap = <div class="last">|</div>
        5.current = 1
    }
}

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com




More information about the TYPO3-english mailing list