Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-02-04 16:46:45

jordi
Member
From: Barcelona
Registered: 2005-09-14
Posts: 94
Website

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

#2 2008-02-05 20:37:18

jordi
Member
From: Barcelona
Registered: 2005-09-14
Posts: 94
Website

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

#4 2008-02-06 10:05:21

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

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

#5 2008-02-06 11:24:57

jordi
Member
From: Barcelona
Registered: 2005-09-14
Posts: 94
Website

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

Board footer

Powered by FluxBB