I'm using this code to display the active category as the title of the page before the channel entries are listed out, however, if you go to the next page using the pagination the category seems to lose it's active status and nothing is returned. Any suggestions?


1st page returns: Category > Active Category Name

2nd page returns: Category >

1st page URL: /sustainability/stories_and_video/category/pillars_passion_for_people

2nd page URL: /sustainability/stories_and_video/category/pillars_passion_for_people/P3

{exp:channel:entries channel="stories" disable="member_data" orderby="article_publish_date" sort="desc" limit="3" pagination="bottom"}
  {if count == 1}
           Category > {categories}{if active}{category_name}{/if}{/categories}
  <div class="pageBlock newsBlock">
    {if story_image != ""}<img class="sus_small_img" src="{story_image:small_images}" />{/if}
    <h2><a href="{page_url}">{title}</a></h2>
    <span id="more"><a href="  {url_title_path='sustainability/story_detail'}">Read more</a></span>
    <p>Page {current_page} of {total_pages} pages {pagination_links}</p>

1 Answer 1


I haven't used the active variable before so I'm not sure why it's not working with pagination, however you should be able to use the segment variable in your conditional instead:

    {if category_url_title == segment_4}{category_name}{/if}
  • I figured that would be my work around if I couldn't resolve this, but just thought I would throw it out there in the interest of keeping everything as dynamic as possible. :) Thanks for your suggestion! Mar 22, 2013 at 15:54
  • Okay, I responded to this before I had my coffee... this solution IS dynamic and is exactly what I needed. Thank you! Mar 22, 2013 at 20: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.