Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Is there a way to style the first article in a list differently?
On my blog page, I’d like to be able to have the most recent post be a full article, while the next 10 or so are in a more compressed list below the most recent post.
I’ve got forms made up for both the “full” post and the “compressed” post, but other than playing around with if_first_article, I can’t figure out a way to get this happening…
Any ideas?
Caps lock is cruise control for cool. —Unknown
Offline
Re: Is there a way to style the first article in a list differently?
Use the limit and offset attributes of txp:article, e.g.
<!-- first article is a full post -->
<txp:article form="full-post" limit="1" />
<!-- remaining articles are compressed posts -->
<txp:article form="compressed-post" limit="10" offset="1" />
TXP Builders – finely-crafted code, design and txp
Offline
Re: Is there a way to style the first article in a list differently?
Or use if_first_article inside your article form.
Code is topiary
Offline
Re: Is there a way to style the first article in a list differently?
Or use if_first_article inside your article form.
Article related: Yep, that’s the best choice. Use article dependent if/else constructs inside the article form. The decision should be parsed much faster than an additional article list tag call.
Page related: I would use limit & offset to add totally different content between single article items in a list.
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline