Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
Hello,

I have been looking and trying to come up with a solution for hours now and I can't seem to get it to work. I'm making a portfolio site using using a cloneable template.

The listview looks like this:
Image

A cloned page has the following pagination/navigation:
Image

Basicly I want the "vorige" (previous) button to display the previous cloned page and the "volgende" (next) button to display the next cloned page. The overzicht (overview) button is just a hardcoded link returning to the list view. Also when I hit the top cloned page I need to disable the previous button (same for the next). Besides that it should take into account the weight of the pages, because I want my client to be able to manually order them.

Weight:
Image

I was able to make it work by sorting them on creation date or page ID. However this does not take the weight into account. Eventually I want to be able to use pretty URLS. I have found nothing on creating previous and next buttons using pretty urls. Maybe I'm searching for the wrong terms as this seems like a feature that would be often used in portfolio websites.

Any help would be greatly apreciated! I have already purchased multiple couch license's and will continue to do so for every client, but this is really frustrating as it is something that is almost required on every portfolio website.

Greetings,

Hobie

TL:DR

I need a way to fetch the pretty url link to the next and previous cloned pages based on weight. Also a way to disable the button if top or bottom has been reached.
Hi,

Please try using the solution described in the following post -
viewtopic.php?f=8&t=7087#p9409

The mentioned solution will require one tweak to make it fetch pages sorted by their weights. Please modify the following line -
Code: Select all
$page_ids = explode( ",", "<cms:pages ids_only='1' />" );

to make is as follows -
Code: Select all
$page_ids = explode( ",", "<cms:pages orderby='weight' order='asc' ids_only='1' />" );

You don't have to worry about prettyURLs as the 'k_page_link' variable will automatically switch to those once prettyURLs are enabled for the site.

Hope this helps. Do let me know.
I'll try it out when I return from school this afternoon. Thanks alot for the quick reply! I'll update here.
Yes works like a charm. Thank you alot.
You are welcome :)
5 posts Page 1 of 1
cron