0

I have read some of the other posts on pagination, but I have not been able to make the products page work with pagination.

Two things are not working for me: 1) paginate="bottom" 2) links point to a P16 that does not exist and the system does not recognize that it is the second portion of the pagination

            <div id="container" class="super-list variable-sizes clearfix">     
            {exp:channel:entries channel="products" orderby="product_date" show_expired="yes" show_future_entries="yes" sort="asc" limit="16" paginate="bottom"}
            <div class="hover panel element {categories backspace="1"}{category_url_title} {/categories}">
                <div class="front">
                    <a href="{title_permalink="products"}"><img src="{product_image}" title="{title}" alt="{title}"/></a>
                </div>

                <div class="back" onClick="location.href='{title_permalink="products"}';" style="cursor: pointer; cursor: hand;">
                        <h2><a href="{title_permalink="products"}" style="text-decoration: none;">{title}</a></h2>
                        <p><a href="{title_permalink="products"}" style="text-decoration: none;">{product_short}</a></p>
                        <p><a href="{title_permalink="products"}" class="button-more">Learn More</a></p>
                </div>
            </div>
    {paginate}
    {if {total_pages} > 1}
    <nav class="centered" role="toolbar">
    <ul class="dots">
    {pagination_links page_padding="5"}
    {previous_page}<li><a href="{pagination_url}">&laquo;</a></li>{/previous_page}

    {page}<li {if current_page}class="active"{/if}><a href="{pagination_url}">{pagination_page_number}</a></li>{/page}

    {next_page}<li><a href="{pagination_url}">&raquo;</a></li>{/next_page}
    {/pagination_links}
    </ul>
    </nav>
    {/if}
    {/paginate}
            {/exp:channel:entries}
        </div><!--END container-->

I know from reading other posts that P16 is coming from the parameter limit="16" and the links point to http://mydomain.com/products/P16 for both the previous and the next links???

They make it look so easy in the documentation, but I cannot get it to work.

Any help will be appreciated. I will check in tomorrow hoping that my day starts off with a new fresh set of ideas - thanks in advance

2 Answers 2

1

It looks like an issue with your conditional. Remove it. Everything inside {paginate} will only be output if you have pages.

Please try to do that.

{paginate}
    {pagination_links page_padding="5"}
    <nav class="centered" role="toolbar">
        <ul class="dots">
                {previous_page}<li><a href="{pagination_url}">&laquo;</a></li>{/previous_page}

                {page}<li {if current_page}class="active"{/if}><a href="{pagination_url}">{pagination_page_number}</a></li>{/page}

                {next_page}<li><a href="{pagination_url}">&raquo;</a></li>{/next_page}
        </ul>
    </nav>
    {/pagination_links}
{/paginate}
1
0

How about this:

{if total_pages != 1}, I had some issues with pagination when using operator > but changed that to != solved my case.

1
  • Thanks for the response. I am working at another company and I have no idea if your suggestion works or not, but I thought I would thank you
    – kronus
    Commented May 13, 2015 at 11:01

Your Answer

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

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