Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-08-20 14:25:28

glenelkins
Member
Registered: 2008-08-28
Posts: 29

<txp:older /> and <txp:newer />

Hi

Why is the <txp:newer> and <txp:older> not showing the links?

[code]
<txp:article_custom allowoverride=“1” form=“news-listing” limit=“5” pgonly=“0” section=“latest-news” sort=“Posted desc” status=“4” />

<p><txp:newer>&laquo;&nbsp;Newer articles|</txp:newer><txp:older>Previous articles&nbsp;&raquo;</txp:older></p>
[/code]

I have also just tested a url like : http://testdomain.com/articles/?pg=2 and all its doing is showing the same articles as the first page!

Last edited by glenelkins (2009-08-20 14:59:33)

Offline

#2 2009-08-20 15:12:47

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,454
Website GitHub

Re: <txp:older /> and <txp:newer />

glenelkins wrote:

Why is the <txp:newer> and <txp:older> not showing the links?

Probably because older/newer don’t work with <txp:article_custom />. From that page:

… while the article tag can only see posts within the currently viewed section/category/author and so forth, article_custom can see all posts from all sections, categories and authors unless you restrict it via attributes (see below), thus context-sensitive navigation tags, such as older and newer, will not work


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2009-08-21 08:29:04

glenelkins
Member
Registered: 2008-08-28
Posts: 29

Re: <txp:older /> and <txp:newer />

hi

<txp:article sort=“Posted desc” limit=“2” form=“news-listing” />

this is not working! I have setup 1 test article in the section “news-test” and the code above is in the default page code used for the section “news-test” I dont understand why its not picking the article up

Offline

#4 2009-08-21 09:34:09

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: <txp:older /> and <txp:newer />

Hi glenelkins,

Can you post a tag trace?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2009-08-21 10:03:56

glenelkins
Member
Registered: 2008-08-28
Posts: 29

Re: <txp:older /> and <txp:newer />

its ok i worked that out

the older and newer links show on the article list fine now! but how do you get them to show on an individual article?

Offline

#6 2009-08-21 10:57:55

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

Re: <txp:older /> and <txp:newer />

For the individual article you need the link_to_next and link_to_prev tags.

Offline

#7 2009-08-21 15:19:19

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: <txp:older /> and <txp:newer />

In the form somewhere you can have something like

<txp:if_article_list>
<txp:older /> | <txp:newer /> <txp:hide> This is when you are in an article list </txp:hide> 
<txp:else />
<txp:link_to_next /> |<txp:link_to_prev /> <txp:hide> This is when you are in an individual article </txp:hide> 
<txp:if_article_list>

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB