Pagination
Tags:
Last Updated: Feb 01, 2011 12:14
- Description
Adds pagination (1,2,3,4 ...) jump to page links to Primo.
- Author: Karsten Kryger Hansen
- Additional author(s):
- Institution: Aalborg Universitetsbibliotek
- Year: 2011
- License: BSD style
- Short description: Use, modification and distribution of the code are permitted provided the copyright notice, list of conditions and disclaimer appear in all related material.
- Link to terms: [Detailed license terms]
- Skill required for using this code: intermediate
State
In Development
Programming language
PHP and JavaScript, but the PHP may be substituted with any server side, or re-programmed in JavaScript.
Software requirements
You need one extra jQuery library; http://plugins.jquery.com/files/jquery.cookie.js.txt
Screen captures
Author(s) homepage
Download
Attach the code file(s) to this page and link to them here.
Page attachments management can be reached from the top-right menu - 'attachments' after page save.
Working example
Using the following Ex Libris open interfaces
None
Changes
Release notes
Text...
Installation instructions
To make this code work, you must have a customized layout in your Primo view. It can work without a customized layout (by placing the code in the footer, but this is currently not supported in the code.
You need a server where you put the pagination file (pagination.php). I have created a PHP-file, but the only PHP part is the request variable parsed by Primo to the tile, to tell the total number of results. This can be done in almost any programming language.
You must make the following modifications to your code:
- Make a link to your own copy of the jQuery cookie plug-in.
- Correct the selector for where the pagination is appended.
When you add the pagination as a custom tile in Primo, you can set the ID and class that the custom tile is wrapped in. And then you must correct the value in this codeline:$('#aubidPagination').html(text);
This is how it looks in our customized view.

TO DO list
- Pagination does not work when it is a mailed link, at least in some cases.
- Better documentation
Known issues
See the TO DO list :)


5 Comments
comments.show.hideMar 15, 2011
Jeff Peterson
Thanks Karsten. This is handy. We added links to jump to the first and last pages too. I can send you the code if you're interested.
Also, for users who do not want to use customized layouts, you could use the "ideasbrief.jsp" page. You would just need to replace this line:
... with something like this:
Jul 22, 2011
Dale Poulter
Jeff,
Which Primo version are you using? Out ideasbrief.jsp only contains:
<!-- ($
)[$
] -->
Thanks.
Sep 21, 2011
Masud Khokhar
Hi Karsten and Jeff,
Thank you for this, it is very useful and we have just used this in our Production Similar environment. Instead of PHP, we are using $
to get the value and ideasbrief.jsp file.
Best wishes,
Masud
Oct 17, 2011
Ulrike Krabo
Hi All,
I don't understand why cookies are needed. Is this feature also possible without using cookies?
BR
Ulrike
Oct 20, 2011
Karsten Kryger Hansen
Hi
As I remember, the cookies are used to store the number of results per page. Otherwise you will not be able to find this information when the user gets to the last page.
I guess if you write some serverside code on the Primo server, you will be able to make it without cookies.
BR,
Karsten