Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-09-30 00:13:52

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

need help with <txp:older> <txp:newer> tags

Hi again,
First time i’ve attempted to use the <txp:older> and <txp:newer> tags and I need some direction.

I need to put an older/ newer conditional statment below this article list, only doing 5 per page.

<h2>News Archives</h2>
<txp:article_custom form=“blog_listing” section=“blog” status=“sticky” />
<txp:article_custom form=“blog_listing” section=“blog” />
<txp:older> <p>older</p></ txp:older> “or” <txp:newer> <p>older</p></ txp:newer>

I know that txp:newer and older don’t work with article_custom. So what do you use a listform in the article tag or just a form?

<h2>News Archives</h2>
<txp:article listform=“blog_listing” section=“blog” status=“sticky” />
<txp:article listform=“blog_listing” section=“blog” />
<txp:older> <p>older</p></ txp:older> or <txp:newer> <p>older</p></ txp:newer>

not getting it.
And how do you do the conditional to make it show the newer or older link?

Last edited by kvnmcwebn (2009-09-30 00:15:31)


its a bad hen that wont scratch itself.
photogallery

Offline

#2 2009-09-30 02:09:56

JanDW
Plugin Author
From: Providence, RI, USA
Registered: 2008-07-18
Posts: 327
Website

Re: need help with <txp:older> <txp:newer> tags

I hope i’m understanding your questions correctly. If you use both a listform and a form, the form will only be used in individual article context. In other words no older or newer show up.

You have to set the attribute limit="5" on the article tag (10 is default).
Setting limit="5" will make the listing (rendered by the listform) jump by 5 when using the older newer links. If there is no newer listing available, the <txp:newer> will render void, same thing for older listings with the <txp:older> – if desired, you can overrule that by setting the showalways attribute.

Hope that helps,

Jan


TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX

Offline

#3 2009-09-30 02:19:22

JanDW
Plugin Author
From: Providence, RI, USA
Registered: 2008-07-18
Posts: 327
Website

Re: need help with <txp:older> <txp:newer> tags

To clarify <txp:article_custom form=“blog_listing” section=“blog” limit="5"/> will use the form attribute for both listing and individual article contexts.

<txp:article_custom form=“blog_article” listform="blog_form" section=“blog” limit="5" /> will use blog_form in listing context and blog_article in individual article context.

Last edited by JanDW (2009-09-30 14:22:52)


TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX

Offline

#4 2009-09-30 09:51:04

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: need help with <txp:older> <txp:newer> tags

ok I got it. I wonder though if I go back to using sticky articles and only wanted to display 5 how would I do it?
Like this there would be ten articles. No big deal though I’m still using categories instead of status for the moment anyway.

<h2>News Archives</h2>
<txp:article listform=“blog_listing” form=“blog_listing” section=“blog” status=“sticky” />
<txp:article listform=“blog_listing” form=“blog_listing” section=“blog” />
<txp:older showalways=“1”><p>Older</p></txp:older>
<txp:newer showalways=“1”><p>Newer</p></txp:newer>


its a bad hen that wont scratch itself.
photogallery

Offline

#5 2009-09-30 10:58:16

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

Re: need help with <txp:older> <txp:newer> tags

If you put a section attribute into article it won’t throw an error, but it won’t do anything either, I’m pretty sure.

Explicitly setting listform to the same form as form is redundant. Again, pretty sure.

Did you get this working the way you want?


Code is topiary

Offline

#6 2009-09-30 14:32:47

JanDW
Plugin Author
From: Providence, RI, USA
Registered: 2008-07-18
Posts: 327
Website

Re: need help with <txp:older> <txp:newer> tags

Jeff is right. I copied the section attribute from your tag without thinking.

About the sticky. Usually I just edit the (one) sticky if I want to add something to it. I think maybe with txp:variable and <txp:rvm_counter /> and a snippet of PHP you could cook up something. But maybe that’s too complicated a solution vs. using a category or just editing the sticky… or maybe someone else has a better idea…


TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX

Offline

#7 2009-10-01 12:32:25

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: need help with <txp:older> <txp:newer> tags

one sticky article, that’s interesting.


its a bad hen that wont scratch itself.
photogallery

Offline

Board footer

Powered by FluxBB