[TYPO3] tt_news first paragraph
Xavier Perseguers
typo3 at perseguers.ch
Sat Aug 23 21:18:53 CEST 2008
Hi,
Lee M. Childress wrote:
> Before I go hacking away at the actual tt_news code, I am sure there is a better way to do this:
>
> When displaying a single view in tt_news I would like only the first paragraph of the news body to have a different class tag than the rest, i.e.:
>
> <p class="bodytext_first">This is the first paragraph of the news story.</p>
> <p class="bodytext">This is the second and remaining paragraphs.</p>
>
> Any decent way to do this without altering the code?
CSS3 (or CSS2 ?) :first-sibling for instance or doing something like that:
<div class="news">
<p class="bodytext">This is the first...</p>
<p class="bodytext">This is the second...</p>
</div>
and in CSS
.news p {
# first
}
.news p+p {
# second and next
}
At least this is the idea...
HTH
--
Xavier Perseguers
http://xavier.perseguers.ch/en
More information about the TYPO3-english
mailing list