4

Pagination is pretty simple but I can't figure out how to have a different pagination style at the top vs the bottom. What I want to do is show the pagination links at the bottom of the results but show some other information that is only available within the pagination tags at the top of my results. I have AB Pagination installed as well so I can use some it's extra tags to show more info.

So my question is, is there a way to have something similar to

{pagination_top} Showing results 1-10 of 56. Show: 10  20 30 per page  {/pagination_top}

{entries loop} stuff here {/entries}

{pagination_bottom} Prev | 1 | 2 | 3 | etc | Next {/pagination_bottom}

Any help would be appreciated! Thanks

2

Render out the pagination in one block, framing the 2 styles of pagination:

{paginate}
  <div id="top-pagination">
    Showing results {abp_entry_from}-{abp_entry_to} of {abp_total_entries}. Show: 10  20 30 per page
  </div>

  <div id="bottom-pagination">
    {pagination_links}
      <ul>
        {previous_page}<li><a href="{pagination_url}" class="page-previous">Previous Page</a></li>{/previous_page}
        {page}<li><a href="{pagination_url}" class="page-{pagination_page_number} {if current_page}active{/if}">{pagination_page_number}</a></li>{/page}
        {next_page}<li><a href="{pagination_url}" class="page-next">Next Page</a></li>{/next_page}
      </ul>
    {/pagination_links}
  </div>
{/paginate}

Then using CSS, position:absolute #top-pagination and ensure there's room for it at the top of the listing.

But not sure how you're going to handle the sorting amount.

Use only paginate="bottom" in the channel:entries tag parameters.

  • Not a bad idea... I'll try it! – Mike Stecker Oct 9 '13 at 20:29
  • Obviously only set paginate="bottom" in the parameters for channel:entries! – Peter Lewis Oct 9 '13 at 20:52
  • Yeah I have it that way. I'm going to use segment variables to change the sorting amount: {if segment_4}limit="{segment_4}"{if:else}limit="30"{/if} and I'll put in the sort links something similar to: <a href="/{segment_1}/{segment_2}/{segment_3}/50">50</a> - obviously not exactly like that but you get the point. – Mike Stecker Oct 9 '13 at 20:56
0

Unfortunately I don't think this is possible. One workaround might be to use multiple {exp:channel:entries} loops on the page, each creating it's own pagination, but obviously that would be a very inefficient solution, so I'd only use it in a last resort on a page you were sure wasn't going to have a lot of load.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.