Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-08 10:16:00

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Alphabetical article lists and Next, Previous navigation

If I’ve used <txp:article sortby=“Title” sortdir=“asc” /> on my homepage to display articles in alphabetical order… how can I provide navigation in the articles themselves to navigate to the next and previous articles in the same order?

Next and Previous are limited to the list itself and older/newer is obviously chronological!

Last edited by douglgm (2006-11-08 10:18:25)

Offline

#2 2006-11-08 10:30:39

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: Alphabetical article lists and Next, Previous navigation

(Edit: I am of course talking about <txp:link_to_prev> and <txp:link_to_next>

Older/newer work (edit: for the article list), but (edit: <txp:link_to_prev> and <txp:link_to_next> ) always give the articles in chronological order.

If the original article list is sorted alphabetically, then the (edit: next/previous navigation) in the individual article do not navigate the next/previous article alphabetically.

I’m not sure I’m expressing myself very well here!

Last edited by douglgm (2006-11-08 10:43:37)

Offline

#3 2006-11-08 10:44:12

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

Re: Alphabetical article lists and Next, Previous navigation

Older/newer should work as expected even if not sorting on posting date, because these tags know which page they’re on and therefore also know which pages surround it. Since the article tag that eventually generates the list uses both the page number and the sort attribute it should do what you want.

link_to_next/prev use just the posted date unfortunately. Making that depend on the sorting order set in the article tag is probably not a trivial task. It’s doable if the sort attribute contains just one thing to sort on, but when you set it to sort on multiple things then it quickly gets more complicated. For starters the link_to_next/prev would have to inherit the value set in the sort attribute of the article tag.

Last edited by ruud (2006-11-08 10:46:21)

Offline

#4 2006-11-08 10:58:20

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: Alphabetical article lists and Next, Previous navigation

Thanks for the reply Ruud. I’ve got no problems with the article list itself, and the pagination navigation. It’s only the “link to next” and “link to previous” that are the problem. As you suggest, is not something that is going to be easy to implement!

If only “link to next/previous” took some arguments such as the sort type and order!

Offline

Board footer

Powered by FluxBB