Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-08-29 02:03:51

Malize
Member
From: Barcelona
Registered: 2007-08-28
Posts: 77
Website

Article list, display penultimate article

Hi,

If this it’s been answered before, sorry. I’m sure it’s so easy, but I couldn’t find the way to do it.

How can I display only the penultimate article?

Thank you :)

Offline

#2 2007-08-29 08:26:58

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Article list, display penultimate article

Assuming you mean not the most recent article, but the second one.

<txp:article_custom limit="2" form="myform" />

myform:

<txp:if_first_article><!-- skip --><txp:else /><!-- show article --></txp:if_first_article>

Offline

#3 2007-08-29 09:43:52

Malize
Member
From: Barcelona
Registered: 2007-08-28
Posts: 77
Website

Re: Article list, display penultimate article

Does this mean that I can do the same with the third, the forth, and so on?

Thank you very much :)

Offline

#4 2007-08-29 10:00:36

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Article list, display penultimate article

Nope, because there is no such thing as a <txp:if_second_article /> tag.
If you wanted to do something like that, then:

second article: <txp:article offset="1" limit="1" />
third article: <txp:article offset="2" limit="1" />
fourth article: <txp:article offset="3" limit="1" />

Offline

#5 2007-08-31 15:19:06

Malize
Member
From: Barcelona
Registered: 2007-08-28
Posts: 77
Website

Re: Article list, display penultimate article

Oh, this one is perfect, thank you very much :)

Offline

Board footer

Powered by FluxBB