Link to previous/next entry using custom sorting order
The weblog:entries tag enables you to link to next/previous entry based on entry creation date.
But what if you want to use sorting order based on other parameter, and still have next/prev links?
Here’s the add-on that will help you!
This is add-on for EE 1.x. If you are looking for EE 2.x version, click here.
Using Entry Linking plugin, you can sort your weblog entries based on any - standard or custom - field you want and make your next/prev links follow that order!
Example usage:
{exp:entry_linking entry_id="1" link="next" weblog="my_weblog"
orderby="my_custom_field" sort="ASC" status="open"
category="1|2"
mode="short"}
<a href="{path=site/{link_url_title}}">{link_title}</a>
{/exp:entry_linking}
entry_id is the required parameter.
Possible values for link are ‘next’ and ‘prev’. Defaults to ‘next’.
You can use your custom field names for orderby parameter (defaults to entry_date).
All returned variables will be prefixed with ‘link_’
You can use the plugin in any part of your template.
The current version of plugin supports only ‘short’ mode (i.e. return only entry_id, title and url_title). I don’t think you need more for pagination
But if you do - please let me know and I’ll include ‘full’ mode in future releases.
The plugin currently supports only EE 1.x, EE 2 support is coming very soon.
For support, please email .(JavaScript must be enabled to view this email address).
Comments
Comments are closed. To get support, email .(JavaScript must be enabled to view this email address).


Thanks! I was just looking for something like this, but couldn’t find anything even remotely useful. Works just great and is flexible enough!
One suggestion though: maybe the first/last links could be hidden if viewing the first/last entry? Now the links are looping the whole weblog. Just an idea
Jani, you can achieve this by replacing
if ($link=='next'){
$pos++;
if ($pos==count($ids)) $pos=0;
} else {
$pos--;
if ($pos==-1) $pos=count($ids)-1;
}
with
if ($link=='next'){
$pos++;
if ($pos==count($ids)) return $TMPL->no_results;
} else {
$pos--;
if ($pos==-1) return $TMPL->no_results;
}
great plugin, thank you.
It would be awesome if you could limit the next and prev links to a specific category as well.
Would that be difficult to accomplish?
James, that sounds like a good feature. I think I’ll code that and release in a week or two.
I second the request to limit to specific categories. That would be awesome.
Nice plugin. Thanks.
Can you let me know when it’s been updated to ‘limit to specific categories”. That would be perfect for a project I’m working on
The ‘limit to specific categories’ feature has been implemented. Use it by passing parameter catagory=“1”. You can specify multiple categories by separating them with a pipe.
Please note that I did not test myself this yet
so if you encounter any bugs, report them here.
The donwload link is in the post above.
Hey,
Thanks for the update.
Have given it a go but I can’t get it to limit to the category I’m on. The ‘category’ tag doesn’t seem to have any effect. Has any one else had any issues?
Cheers
Steve, do you use ‘category’ tag or parameter? You should use parameter (like in example in docs).
If you are willing, I can have a look at your installation and quickly fix everything.
Soon after - bugfix version (1.2). Please download and install this one.
Great plugin!
I second the request to be able to turn off the looping between the last-to-first and first-to-
last of the results.
Could you provide any quick fixes to this?
Eek, I just noticed that you had followed up already on this topic. I was thrown off by the order of the comments.
The fix you posted worked really great! Thanks again for an awesome plugin.
You’re welcome, Mason
Very useful article.Surely will visit your blog again later,thanks for sharing.
Hi, I am hopeing to use this plug-in for pagnation within a gallery created using channels. The problem I have is that the plug-in isn’t showing in the manager. I have uploaded the plug-in to the ‘third party’ folder, and like other plug-ins I’m using I expected it to automatically show? I’m using EE2.
Many Thanks.
Hello maz,
this is plugin for EE 1.x
I have development of version for EE2 in my plans, but that will probably not free anymore. Would you be willing to pay a small fee (like $5) for such plugin? If yes, I can start development immediately and it will be ready soon.
Hi, Thank you for your reply. The user guide for EE pagnation states:
“Pagination will also automatically restrict itself to any category you’re currently viewing. So if you have a category specified in your channel entries tag or you are viewing the entries of a category, then the pagination links will automatically restrict themselves to only entries in that category.
So I shouldn’t need a plug-in. I’m going to dabble some more and try figure this out, but thank you for offering and I may get back to you (I hope thats ok).
Thanks again.
“
Glad you figured that out. The main feature of this plugin is custom sorting order and not category restiction, after all.
Do not hesistate to contact me again if you need any help.
I’d be quite happy to have a 2.1 version of this, and would also be happy to $5 for it. I’m working on a 2.1 photo gallery site, and it sounds like this would just be the thing I need.
Oh, additionally: what I’m really looking for is also to be able to filter for the last entry so that the “next” button will take you to an entirely different page, say, the front page of the site or whatever. Is that possible?
Hi strudel.
The feature you request is possible.
Expect EE 2.x version in a few days (I’ll let you know)
For all of you interested, the Entry Linking for EE 2.x is available on this page and from Devot:ee
get facebook likes
how to get facebook likes
get 1000 facebook likes buy facebook likes get 1000 facebook likes
o.k. this thing called security tool kept popping up and telling me all these viruses I had on the computer. Well now it completely blanked out my screen making it the only thing visible and everytime I try presing Ctrl + Alt + Delete to go to my task manager it blocks it off with a virus pop up!!! The only way i’m on the internet right now is because I went threw start… PLEASE help me, there is absolutly no way for me to get this of my computer! Now it says it has a firewall up that blocks my internet. This is doing more harm then good as you see obviously.
I’m a I.T. student.And also about virus related,antivirus software related websites also i need.Please help me out.Advance Thanks!!! buy facebook likes
get 1000 facebook likes get facebook likes <a >how to get facebook likes </a> get 1000 facebook likes