ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Search results - pagination

February 28, 2011 4:02am

Subscribe [3]
  • #1 / Feb 28, 2011 4:02am

    Crnaovca

    627 posts

    How to do pagination in search results? There is option results=“20” for example, but that is in search form.

    Does anyone have sample of basic working search results WITH pagination. If I put pagination inside search results tag, that tag is not processed at all, if I put it outside, obviously it is not working :D

    In docs there is no example I can find with pagination, and in “search results” there is no mention about that also.

  • #2 / Feb 28, 2011 3:16pm

    Ingmar

    29245 posts

    Have you tried the example from the docs? It has pagination, too. What version and build of EE are you using?

  • #3 / Feb 28, 2011 6:21pm

    ralph.m

    225 posts

    I tried adding pagination to search results a while back, but also couldn’t get it to work. This is the simple search code that works:

    <h1>Search Results</h1>
            
    Here are the results of your blog search:
    {exp:search:search_results}
      <div class="entries">
      <h2><a href="http://{title_permalink=">{title}</a></h2>
    <p>  {blog-post-intro}<br />
      </div><br />
    {/exp:search:search_results}

    Adding this after it had no effect:

    {if paginate}
      <div class='paginate'>
      <span class='pagecount'>{page_count}</span>  {paginate}
      </div>
    {/if}

    So I was trying to figure out what determines “if paginate” is true or not. The docs don’t seem to mention that. I tried adding things to {exp:search:search_results} like

    {exp:search:search_results limit="20"}

    and

    {exp:search:search_results paginate="20"}

    and

    {exp:search:search_results paginate="on"}

    ... but never got it working.

  • #4 / Mar 01, 2011 9:43am

    Sue Crocker

    26054 posts

    Hi, ralph.m.

    You set the value this way:

    {exp:search:simple_form channel="news" result_page="search/results" no_result_page="search/no_results" search_in="everywhere" results="1"}

    In the simple search form itself.

    Does that help?

  • #5 / Mar 02, 2011 8:31am

    ralph.m

    225 posts

    Does that help?

    O yeah! So easy when you know how. Thanks very much for explaining it Sue. Works a charm now.

  • #6 / Mar 02, 2011 3:34pm

    Ingmar

    29245 posts

    Woot! Crnaovca, where are you with this?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases