Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-03-05 05:36:28

surfwax95
Member
Registered: 2008-04-04
Posts: 38
Website

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

#2 2010-03-05 07:20:56

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,940
Website GitHub

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

#3 2010-03-05 13:39:06

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

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

#4 2010-03-05 15:34:46

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

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

Board footer

Powered by FluxBB