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.

Pagination using Dynamic Parameters

December 15, 2012 12:33pm

Subscribe [1]
  • #1 / Dec 15, 2012 12:33pm

    LW4 Comm

    16 posts

    Hi, I kinda new to EE and I’m trying to create a pagination using dynamic parameters. Do you have docs on a working version of this.  The code I have now doesn’t hold the limit once I click next.

    I’m using
    ExpressionEngine v2.5.3 - Build Date: 20120911
    Mo Variables

    This is what I have thus far.

    {exp:channel:entries channel="products" status="Open|Active" {if segment_2}limit="{get_post:limit}"{/if} {if segment_2 ==""}limit="25"{/if} orderby="url_title" sort="asc" dynamic="no" paginate="both" dynamic_parameters="limit" search_id="{segment_2}" disable="trackbacks|member_data"}
     <div class="grid_2 product" >
      {if product_images}
      {exp:channel_images:images entry_id="{entry_id}" limit="1"}
       <a href="http://{path=%27products/{categories">{image:url:small}</a>
      {/exp:channel_images:images}
      {if:else}
       <a href="http://{path=%27products/{categories">{site_url}images/tps-default.gif</a>
      {/if}
      <br>
      <div  6px 4px;">
       <a href="http://{path=%27products/{categories"><span class="itemTitle">_   {exp:trunchtml chars="50" inline="..."}{exp:tagstripper:tagsToStrip tags="img"}_   {title}_   {/exp:tagstripper:tagsToStrip}{/exp:trunchtml}_   </span></a>
      </div>
     </div>
     
     {paginate}
      {if {total_pages} > 1}
      <div class="clear"></div>
      <br>
      <div class="grid_8 pagingBg" >
       <form acti method="post" search_id="{segment_2}">
       <div class="grid_5" >{absolute_total_results} Results  |  Per page: 
        <select name="limit" id="limit" >
         <option value="25"{if {get_post:limit} == 25} selected="selected"{/if}>25</option>
         <option value="50"{if {get_post:limit} == 50} selected="selected"{/if}>50</option>
         <option value="75"{if {get_post:limit} == 75} selected="selected"{/if}>75</option>
         <option value="100"{if {get_post:limit} == 100} selected="selected"{/if}>100</option>
        </select>
        <input type="submit" value="Go!" />
       </div>
       </form> 
       
       <div >
       <table height="24">
        <tr>
         {if previous_page}
         <td ><a href="http://{auto_path}">{site_url}images/previous-arrow.png</a>   </td>
         {/if}
         <td>{current_page} of {total_pages}</td>
         {if next_page}
         <td >   <a href="http://{auto_path}">{site_url}images/next-arrow.png</a></td>
         {/if}
         <td>       
         {pagination_links}
         <span>
         {first_page}<a href="http://{pagination_url}class=paginateLink"><strong>≤</strong></a>  {/first_page}{page}{if current_page}<strong>{pagination_page_number}</strong>{if:else}<a href="http://{pagination_url}class=paginateLink">{pagination_page_number}</a>{/if} {/page}{last_page}<a href="http://{pagination_url}class=paginateLink"><strong>≥</strong></a>{/last_page}
         </span>
         {/pagination_links}
         </td>
        </tr>
       </table>       
       </div>
      </div>
      <div class="clear"></div>
      <br><br>
      {/if}
     {/paginate}
    {/exp:channel:entries}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases