0

I'm trying to get some pagination at the bottom of my search results, and I can't seem to get it to work. All the results display as expected, but there's no pagination at the bottom. Here's my code:

<div class="col-100">

    <h1 class="section-header">{exp:search:total_results} Result(s) for "{exp:search:keywords}"</h1>


        <ul>
            {exp:search:search_results paginate="bottom" limit="4"}
                <li><strong><a href="{auto_path}">{title}</a></strong> from <em>{channel}</em><br/>{excerpt}<br/></li><br/>


        {if count == total_results}
        </ul>
        {/if}
        {paginate}
            <p>Page {current_page} of {total_pages} pages {pagination_links}</p>
        {/paginate}
        {/exp:search:search_results}

</div>
4

Your code looks correct. Could it be that you only have a single page of search results?

I see you have a limit parameter on the tag, but it actually does not accept that parameter. The number of search results per-page is actually determined by the results parameter on the Search Form tag which sends you to the results page.

3
  • I've added the results parameter to my search form tag, and it still doesn't seem to work. I've double-checked the documentation for the search form to be sure I'm doing it correctly, and it seems that I am. – hyphen81 Feb 6 '13 at 2:38
  • Just to clarify - your {exp:search:total_results} tag is outputting a number which is larger than the number you've set as the value for results in your Search Form tag, yet your pagination links are not showing up? – Derek Hogue Feb 6 '13 at 4:57
  • yes, I had my results set to 5 and the search was returning 12 results. I honestly don't know what I did, but it seems to be working this morning. Literally the only thing I've changed this morning was adding the value attribute to the search field so that it would say "search" by default. Anyway, your answer pointed me in the right direction with the results parameter, so thank you for the help! – hyphen81 Feb 6 '13 at 11:36

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.