Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-11-15 16:53:12

AlexStacey
Member
Registered: 2007-11-09
Posts: 22

previous / next article links

I’m tring to display the words prev: and next: before the links at the end of a post. At the moment the words is showing up even if there is no previous/next article. Does anybody know why this isn’t working?

<txp:if_first_article>
<txp:else />
<p>prev: <txp:link_to_prev><txp:prev_title /></txp:link_to_prev><br />
</txp:if_first_article>
<txp:if_last_article>
<txp:else />
next: <txp:link_to_next><txp:next_title /></txp:link_to_next></p>
</txp:if_last_article>

also, on a side note, is there a way to negate an if tag to avoid having to use an empty tag and an <txt:else /> ?

Thanks =]

Offline

#2 2007-11-15 21:24:08

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: previous / next article links

If you are sorting by ‘posted desc’ you should switch if_first_article and if_last_article. Your first article is the newest, so there is not a ‘next article’, but there is a previous one. And the other way around.

Offline

Board footer

Powered by FluxBB