[TYPO3-english] odd / even classes for every second record
Tyler Kraft
tyler.kraft at netefficiency.co.uk
Tue Jan 12 13:12:25 CET 2010
Hi
> 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
> }
> }
This is probably the best way of doing it IMO. Thanks for posting this
Joey - I was looking for an example like this the other day and couldn't
find one. I know there is a reason for having 5.current=1 but I can't
remember why it's there. Can you please explain it briefly.
Thanks,
Ty
More information about the TYPO3-english
mailing list