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.

channel:entries loop and paginate

June 21, 2013 10:47am

Subscribe [1]
  • #1 / Jun 21, 2013 10:47am

    Wabi Sabi Press

    8 posts

    Hi,

    I am not sure if anyone can help on this, but I have a products page which loops inside of a <ul> to output a list of items, see code below.

    The page is limited to 18 items only, 6 rows of 3 items. However I need to display pagination links at the bottom.

    The issue is that if I put the pagination code inside the ‘channel:entries’ tag, the pagination becomes part of the list!

    What I need to do is have the loop of 18 items and then have the pagination code outside of the loop, but inside the ‘channel:entries’ tag.

    Does anyone know how I would do this? I have tried all kinds of ways, but nothing is working.

    channel:entries loop below;

    <div class="row"> <!-- start .row -->
    <ul>
    {exp:channel:entries channel="store" status="open" orderby="date" sort="desc" limit="18" paginate="bottom"}
    {exp:store:product entry_id="{entry_id}"}
    <li class="span4 {switch="||last"}"> <!-- start .span4 -->
    <a href="http://{title_permalink=store/detail}">_{product_image_one}_<div id="overlay">_{if total_stock > 0}_<h4>{product_manufacturer}</h4><p>_{short_description}_{if:elseif total_stock < 1}_<h4 class="sold">SOLD OUT</h4>_{/if}_</div>_</a><br />
    </li><br />
    {/exp:store:product}<br />
    {/exp:channel:entries}<br />
    </ul><br />
    </div> <!-- end .row -->

    Pagination code, which should be inside the channel:entries

    {paginate}
    <div class="pagination">
    {if "{total_pages}" != 0}{pagination_links}{/if}
    </div>
    {/paginate}

    Many thanks in advance if you can help.

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

ExpressionEngine News!

#eecms, #events, #releases