Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

erskinedesign/ed.pagination.ee_addon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

ED pagination for ExpressionEngine 2.x

A more friendly approach to EE channel pagination.

This feature is now available as part of EE2.3 and works almost identically. See the documentation for more information.

Installation

  1. Copy ext.ed_pagination.php to system/expressionengine/third_party/ed_pagination
  2. Enable in the control panel

Usage

All the original pagination methods and malarkey are supported, but in addition you may use the ed_pages tag pair.

Variables:

  • href the url to the paginated page
  • cur a string containing ‘cur’ if the page in the loop is the current one
  • page_no an integer of the current page int the loop
  • ed_first_poge_href the url to the first paginated page
  • ed_last_page_href the url to the last paginated page

Example template usage:

{paginate}

{if "{total_pages}" > "1"}
<div class="pagination">
    <p>Page {current_page} of {total_pages}</p>
    <ul>
        <li class="first_page"><a href="{ed_first_page_href}">First page</a></li>
        {if previous_page}
        <li class="prev_page"><a href="{auto_path}">&lt;</a></li>
        {/if}
        {ed_pages}
        <li class="{cur}"><a href="{href}">{page_no}</a></li>
        {/ed_pages}
        {if next_page}
        <li class="next_page"><a href="{auto_path}">&gt;</a></li>
        {/if}
        <li class="last_page"><a href="{ed_last_page_href}">Last page</a></li>
    </ul>
</div><!-- //.pagination -->
{/if}

{/paginate}

Which would output:

<p>Page 2 of 4</p>
<ul>
    <li class="prev_page"><a href="/path/to/page/">&lt;</a></li>
    <li class=""><a href="/path/to/page/">1</a></li>
    <li class="cur"><a href="/path/to/page/P5">2</a></li>
    <li class=""><a href="/path/to/page/P10">3</a></li>
    <li class=""><a href="/path/to/page/P15">4</a></li>
    <li class="next_page"><a href="/path/to/page/P10">&gt;</a></li>
</ul>

That’s based on there being a limit of 5 in your entries tag.

About

More friendly pagination for ExpressionEngine 2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages