stefangabos / Zebra_Pagination

A generic, Twitter Bootstrap compatible, pagination library for automatically generating navigation links

Home Page:https://stefangabos.github.io/Zebra_Pagination/Zebra_Pagination/Zebra_Pagination.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BS4 pagination classnames

gabisajr opened this issue · comments

Hi,

I hit rock bottom been using the class for the past to years to get things in order.
BS4 has page-item and page-link, for <li> & <a> ..

Check it out on your side and see if it works well

` ```
private function _show_previous()
{

    $output = '';

    // if "always_show_navigation" is TRUE or
    // if the number of total pages available is greater than the number of selectable pages
    // it means we can show the "previous page" link
    if ($this->_properties['always_show_navigation'] || $this->_properties['total_pages'] > $this->_properties['selectable_pages'])

        // if we're on the first page, the link is disabled
        $output = '<li' . ($this->_properties['page'] == 1 ? ' class="disabled page-item"' : ' class="page-item"') . '><a class="page-link" href="' .

            // the href is different if we're on the first page
            ($this->_properties['page'] == 1 ? 'javascript:void(0)' : $this->_build_uri($this->_properties['page'] - 1)) . '"' .

            // good for SEO
            // http://googlewebmastercentral.blogspot.de/2011/09/pagination-with-relnext-and-relprev.html
            ' rel="prev">' .

            ($this->_properties['reverse'] ? $this->_properties['next'] : $this->_properties['previous']) . '</a></li>';

    // return the resulting string
    return $output;

}

This is now fixed in 2.3
Thanks!