0

We are using pagination_links throughout a site and would like for the tag page to match. I'm wondering if there's a way to get pagination_links to work with Tag? I tried simply adding "tag_" to all the variables, but that did not work.

This is the pagination_links code we are using:

{paginate}
  {pagination_links page_padding="5"}
<hr>
    <ul class="pagination">  
      {first_page}
        <li><a href="{pagination_url}" class="page-first">First Page</a></li>
         {/first_page}

         {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}

        {last_page}
          <li><a href="{pagination_url}" class="page-last">Last Page</a></li>
         {/last_page}
       </ul>
<hr>
    {/pagination_links}
{/paginate}

1 Answer 1

0

Which template tag are you using? Tag:Entries? If so, just prepend the {paginate} and {pagination_links} variable pairs with tag_, and no others (Re: Docs).

Your final solution would look like this:

{tag_paginate}
   {tag_pagination_links page_padding="5"}
      <ul class="pagination">  
         {first_page}
            <li><a href="{pagination_url}" class="page-first">First Page</a></li>
         {/first_page}
         {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}
         {last_page}
            <li><a href="{pagination_url}" class="page-last">Last Page</a></li>
         {/last_page}
      </ul>
   {/tag_pagination_links}
{/tag_paginate}
3
  • That did it, thanks. I'll try and read more closely next time (I need a vacation).
    – pedalGeoff
    Dec 22, 2014 at 4:57
  • Hmm... I thought it was working, anyway. Using that code within the tag:entries tag, this is what is rendering on the page: {tag_pagination_links page_padding="5"} {first_page} First Page {/first_page} {e2c518d61874f2d4a14bbfb9087a7c2dprevious_page} Previous Page {/e2c518d61874f2d4a14bbfb9087a7c2dprevious_page} {page} {pagination_page_number} {/page} {e2c518d61874f2d4a14bbfb9087a7c2dnext_page} Next Page {/e2c518d61874f2d4a14bbfb9087a7c2dnext_page} {last_page} Last Page {/last_page} {/pagination_links}
    – pedalGeoff
    Jan 6, 2015 at 16:25
  • It likely does not accept advanced parameters like "page_padding". Try removing that and see if it parses. :)
    – Solspace
    Jan 6, 2015 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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