ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Pagination - Inactive Prev and Next Links

January 18, 2009 12:34am

Subscribe [2]
  • #1 / Jan 18, 2009 12:34am

    underskor

    25 posts

    Today I was setting up pagination, and realised that there seems to be no option to allow ‘Next’ and ‘Previous’ links to be displayed when you are at the end of the result range (they disappear by default). I was after a uniform look, so I made a couple of quick adjustments to the pagination library to allow this, and thought I’d share incase anyone finds it useful. Similarly, these modifications would provide direction if you wish to do the same for the ‘First’ & ‘Last’ links.

    It may be best do the following modifications in reverse order, to avoid line number references becoming incorrect.

    system/libraries/Pagination.php

    //Line 49 - Insert the following
    var $next_tag_open_inactive    = '<span class="nextInactive">'; //Values set for example
    var $next_tag_close_inactive   = '</span>';
    //Line 51 - Insert the following
    var $prev_tag_open_inactive    = '<span class="prevInactive">';
    var $prev_tag_close_inactive   = '</span>';
    //Line 198 - Insert the following
    else
    {
        $output .= $this->prev_tag_open_inactive.$this->prev_link.$this->prev_tag_close_inactive;
    }
    //Line 223 - Insert the following
    else
    {
        $output .= $this->next_tag_open_inactive.$this->next_link.$this->next_tag_close_inactive;
    }

    If anyone has any comments or suggestions, I’d be interested to hear them.

  • #2 / Jan 18, 2009 5:08am

    xwero

    4145 posts

    You could try out my pagination plugin for the same flexibility.

    With the plugin you can add this in the template file based on the existence of the $prev and $next variables.

    The first and last link don’t disappear because IMO those links are constants.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases