1

I have a very standard news feature on the site i'm working on which has both categories and pagination for the entries. A problem i'm having is that the pagination is not filtering by category in the link it is generating.

When I am on a category URL (i.e. /news/category/general) this is not included in the {pagination_url} tag, meaning when you click it goes to the non categorised second page. The link I would expect is /news/category/general/P5 and I'm getting /news/P5

Is this a bug or am I doing something wrong?

Here is a shortened version of the tags:

{exp:channel:entries channel="news" orderby="date" sort="desc" paginate_base="news" paginate="bottom" limit="5"}

    CONTENT

    {paginate}
        {pagination_links}
            <ul id="pagination">
                {first_page}<li><a href="{pagination_url}">&larr; First</a></li>{/first_page}
                {previous_page}
                    <li><a href="{pagination_url}">&larr;</a></li>
                    <li class="disabled">&hellip;</li>
                {/previous_page}
                {page}<li{if current_page} class="active"{/if}><a href="{pagination_url}">{pagination_page_number}</a></li>{/page}
                {next_page}
                    <li class="disabled">&hellip;</li>
                    <li><a href="{pagination_url}">&rarr;</a></li>
                {/next_page}
                {last_page}<li><a href="{pagination_url}">Last &rarr;</a></li>{/last_page}
            </ul>
        {/pagination_links}
    {/paginate}
{/exp:channel:entries}
1

Found the answer, you cannot have pagination_base set if you want it to include /category/general/ in the URL, it skips these otherwise.

| improve this answer | |

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.