Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-12-06 08:35:45

Alex007
Member
Registered: 2007-10-24
Posts: 57

Paginating through a list of articles

Hi All

I have a section called ‘news’ and a category called ‘Latest-News’ – I am trying to get the page to display all the articles in the category and then use the older/newer tags to paginate through. When i use the code below without a category it doesn’t show the newer/older but displays all the articles in the category.

When i do use a category in the url like so index.php?c=Latest-News&s=news it shows the older/newer but only displays the articles in the news section ;(

<code>
<txp:if_individual_article> <txp:article limit=“1” form=“news” /> <p><txp:link_to_prev><txp:prev_title /></txp:link_to_prev> <txp:link_to_next><txp:next_title /></txp:link_to_next></p>
<txp:else /> <txp:if_category> <h3>Articles in category <txp:category title=“1” />:</h3> <txp:article sort=“desc” limit=“3” form=“news” /> <txp:else /> <txp:article_custom category=“Latest-News” limit=“4” form=“news” /> </txp:if_category>

<p><txp:older><txp:text item=“older” /></txp:older> <txp:newer><txp:text item=“newer” /></txp:newer></p> </txp:if_individual_article> <code>

Can anyone see what i am doing wrong – surely listing articles within a category and using the older/newer can be done.

Thanks in adavance.
A.

Offline

#2 2007-12-06 11:36:45

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Paginating through a list of articles

Move the </txp:if_individual_article> closing tag to just after the </txp:if_category> closing tag, then wrap the “older” “newer” tags with <txp:if_article_list> tags.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB