Access Keys:
Skip to content (Access Key - 0)
My Area (Access Key - 2)


Toggle Sidebar
Your Rating: Results: PatheticBadOKGoodOutstanding! 1 rates
Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

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

http://www.aub.aau.dk

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

http://aub.aau.dk/primo

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 :)


Comments

Page Attachments

File NameCommentSizeNumber of Downloads
pagination_customlayout.jpgView configuration in Primo29 kB454
pagination.phpPagination in Primo3 kB170

Added by Karsten Kryger Hansen on Jan 31, 2011 15:25, last edited by Karsten Kryger Hansen on Feb 01, 2011 12:14

  1. Mar 15, 2011

    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: 

    1. Jul 22, 2011

      Jeff,

      Which Primo version are you using?  Out ideasbrief.jsp only contains:

      <!-- ($

      Unknown macro: {param.resultCount}

      )[$

      Unknown macro: {param.query}

      ] -->

      Thanks.

  2. Sep 21, 2011

    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 $

    Unknown macro: {param.resultCount}

    to get the value and ideasbrief.jsp file.

    Best wishes,

    Masud

    1. Oct 17, 2011

      Hi All,

      I don't understand why cookies are needed. Is this feature also possible without using cookies?

      BR

      Ulrike

      1. Oct 20, 2011

        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

Adaptavist Theme Builder Powered by Atlassian Confluence