[Typo3] (easy) way to distinguish the first content element in a column?
Martin Kindler
kindlerm at arcor.de
Tue Oct 4 14:49:20 CEST 2005
Ernesto,
thank you!
I know how to do what I want with style sheets (and as I am porting an
existing design to T3, I'ld rather stick with my old classes), and now, with
your advice, I know how to apply it.
BTW: my old solution was to split the list in two parts, one with the first
element and the other with the rest using select.
Not really a performance booster ...
Martin
> -----Ursprüngliche Nachricht-----
> Von: typo3-english-bounces at lists.netfielders.de
> [mailto:typo3-english-bounces at lists.netfielders.de] Im
> Auftrag von Ernesto Baschny [cron IT]
> Gesendet: Dienstag, 4. Oktober 2005 14:16
> An: typo3-english at lists.netfielders.de
> Betreff: Re: [Typo3] (easy) way to distinguish the first
> content element in a column?
>
>
> Martin Kindler schrieb am 04.10.2005 13:54:
>
> > I am trying to give a special treatment to the very first (or last)
> > content element in a column of my web site. How can I find
> out in TS
> > whether the currently rendered cObject is the first (or last)?
>
> To see if its the first one is easy:
>
> if.value=1
> if.equals.data = cObj:parentRecordNumber
>
> cObj:parentRecordNumber is an counter for all records on the
> current parent. So if its "1", its the first.
>
> > To be more specific:
> > I want to separate two content elements in a column by a separator
> > element. This must not show at the beginning and end of the list.
>
> Apply a CSS-style to the "header" of each element. There is
> already a special class for the first header (in
> css_styled_content), which is "csc-firstHeader", so you don't
> even need any special TS for this. Just
> style:
>
> hX { border-top: 1px solid black; }
> hX.csc-firstHeader { border-top: none; }
>
> where hX is your default header type.
>
> If you need some more fancy "separator element" than what can
> already be done with CSS, you can use the same trick (check for
> cObj:parentRecordNumber) to "prepend" some cObject to every
> content object BUT the first one. Something like:
>
> tt_content.stdWrap.preCObject = TEXT
> tt_content.stdWrap.preCObject {
> value = <hr />
> if.value = 1
> if.isGreaterThan.data = cObj:parentRecordNumber
> }
>
> will add a <hr /> between each content element.
>
> Cheers,
> Ernesto
> _______________________________________________
> Typo3-english mailing list
> Typo3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>
More information about the TYPO3-english
mailing list