My First ModX Snippet - PrevNextLinks

Next post: My essential XP software installation list Previous post: My essential Kubuntu software installation list

Posted by Al Twohill on 24 January 2008 | 0 Comments

Tags: ,

I wanted something like what modx has as navigation in its help section, but couldn't find a snippet that did it. So I wrote my own.

PrevNextLinks.php.snippet 

It's nothing majorly fancy, but its the first time I've actually written a snippet rather than just nicking other peoples and tinkering. Basically what it does is create the Previous and Next post links that you can probably see below the page header. I've tried to make it as adaptable as possible so it is useful to others, and not just me.

You can download it from here. Once you've downloaded it, create a new snippet called PrevNextLinks and copy and paste the text into it.

Usage

Just place the call

[!PrevNextLinks!]

on your page where you want the links to appear. If you look at the code in the snippet there are several config settings that let you change the sorting order, the link text, the classes that are wrapped around the links etc. You can do this from your snippet call, like

[!PrevNextLinks? &sortBy=`menuindex` &sortDir=`DESC`!]

Or just change the defaults in the snippet.

Let me know if you find this usefull!

 


Post your comment

Comments

No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments