Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
link to prev/next from several sections
Standard TXP link_to_prev and link_to_next seem to restrict their output to articles in the current section only. In this site I’m working on, however, when in an individual article page (which may belong to one of three different sections), I need links to prev and next that take into account articles from these three sections.
I’ve been searching, but I can’t find an answer to this. Is there a way to make it so? Thanks.
Offline
Re: link to prev/next from several sections
solved, more or less, by hardcoding the sections I need in the jra_links plugin and using this instead of the Textpattern tags. Not nice, but it works. Just in case somebody wants to know :)
Offline
#3 2008-02-05 22:33:37
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: link to prev/next from several sections
Good to hear you solved it :) I had not heard of that plugin (there isn’t even a forum thread). Maybe you could ask the plugin author to add multiple sections as a feature?
Offline
Re: link to prev/next from several sections
i use jk_neighbour for this.
edit: oh, wait, maybe it’s just for categories
Last edited by kemie (2008-02-06 10:05:41)
~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~
Offline
Re: link to prev/next from several sections
kemie: yes, I think that jk_neighbour does pretty much the same thing that jra_links, only that one lets you choose one category and the other one section.
els: I’ve left a couple of messages in the plugin’s author site with this suggestion and a link to this thread. It should not be too difficult, I think, but my knowledge of php is close to zero.
In any case, here is what I did:
original plugin code:
<code> $where = ’1=1 and Status=4 ‘;
if ($section) {$where .= “and section=’”.$section.”’ “;}</code>
the hack:
<code> $where = ’1=1 and Status=4 and Posted < now() ‘;
if ($section) {$where .= “and (section=‘blog’ or section=‘web’) “;}</code>
I had to add the “posted” bit, because otherwise it was pulling also any articles with future date.
Thank you both for the attention.
Last edited by jordi (2008-02-06 11:28:59)
Offline