I'm currently developing a site and have run into a little bug, all but one category are working fine, the one that isn't working outputs all product entries from the whole site, any ideas why this would happen? My code is as follows:

{if segment_2 == "category"}

  {embed="site/_header" page_name="product_list"}

  {exp:channel:category_heading channel="products"}

  <div class="secondary-col">
    <ul class="categories">
    {exp:channel:categories show_empty="no" {if segment_1 == "cave"}category_group="3"{/if}{if segment_1 == "climb"}category_group="4"{/if}{if segment_1 == "camp"}category_group="5"{/if}{if segment_1 == "walk"}category_group="6"{/if}{if segment_1 == "clothing"}category_group="7"{/if}{if segment_1 == "accessories"}category_group="8"{/if}{if segment_1 == "brands"}category_group="2"{/if}}
        <a href="/{segment_1}/category/{category_url_title}">{category_name}</a>

  <div class="primary-col">

    {exp:channel:category_heading channel="products"}
        {if category_description}
            <div class="introduction"><p>{category_description}</p></div>

    {exp:channel:entries channel="products" limit="50" paginate="bottom"}

    <ul class="product-list">
      {exp:store:product entry_id="{entry_id}"}
          <a href="{url_title_path='products'}">
              {if on_sale}
                <span class="label label-success">Save {you_save} ({you_save_percent}%)</span>

              <li><a href="{pagination_url}" class="page-first">First Page</a></li>

              <li><a href="{pagination_url}" class="page-previous">Previous Page</a></li>

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

              <li><a href="{pagination_url}" class="page-next">Next Page</a></li>

              <li><a href="{pagination_url}" class="page-last">Last Page</a></li>


 </div> <!-- /primary-col-->

You can view the problematic page here, it doesn't output the category title or anything, suggesting it can't find the category, but the category is being output from both the main navigational dropdowns and the secondary navigation on the left, there are 5 products assigned to this category too:


here's how a similar page looks:


1 Answer 1


I'm guessing you're using the category in url feature, with the identifier of "category". I'd expect the issue is occurring due to no products assigned to that category, or that the category url is incorrect.

This URL does the same: http://inglesport.rmdyapps.co.uk/cave/category/blah

I'm assuming it can't find a valid category URL in the current URL, so the channel:entries tag is then pulling back all products (because it has no restriction).

If it were me, I'd approach it using Low Seg2Cat and then use the category parameter in the channel:entries call. That way you have full control and can utilise the no_results conditional and have {if "{last_segment_category_id}" == ""} to trap invalid category URLs.

  • Turns out it was because we had the category static-ropes in two category parents, when I delete one of them the other works. I'm assuming you can't have the same name for a category in two groups :(!
    – Nick
    Commented Sep 13, 2013 at 16:06
  • Yes you can have duplicate category URLs, but you risk exactly what you've encountered. One way to resolve would be to specify the category group used in the channel:entries tag using category_group parameter. But if you've split your products into different groups, you'll want this template to cover all the groups, so doesn't help you. Commented Sep 13, 2013 at 16:17

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.