0

This is my code:

{exp:channel:categories channel="products_insurance" style="linear"}
                <li data-submenu-id="submenu-{category_name}">
                    <a href="{path='borrow/#filter={category_url_title}'}">{category_name}</a>
                        <ul class="submenu">
                            {exp:channel:entries category="{category_id}"}
                            <li><a href="{url}">{title}</a></li>
                            {/exp:channel:entries}

                         </ul>
                 </li>
{/exp:channel:categories}

this part though:

{exp:channel:entries category="{category_id}"}
<li><a href="{url}">{title}</a></li>
{/exp:channel:entries}

is not looping, it's only showing the entries for the first category.

This is for a custom dropdown menu I'm working on.

Any ideas why it's not looping? From what I can tell it should be.

1
  • Ok, What happens when you drop just the {category_id} in the outer loop? Do you get a full list of category_id's? – jrothafer Jul 14 '15 at 15:56
0

As JChrono asks, please verify the outer categories loop is putting all relivent ID's out.

Further still, to avoid any unwanted URL interference add the dynamic tag to your channel entries loop, also try forcing the parse order with parse="inward" on the categories loop, like so :

{exp:channel:categories channel="products_insurance" style="linear" parse="inward"}
  <li data-submenu-id="submenu-{category_name}">
    <a href="{path='borrow/#filter={category_url_title}'}">{category_name}</a>
      <ul class="submenu">
        {exp:channel:entries category="{category_id}" dynamic="no"}
                        <li><a href="{url}">{title}</a></li>
        {/exp:channel:entries}
      </ul>
   </li>
{/exp:channel:categories}

Just a couple of simple things to try first, let us know if we need to get more in depth on this.

2
  • yup. turning dynamic off in the entries loop did it, as well as the parse="inward". Simple answer as usual. I'm still gettting used to EE Tags. – Peter Binks Jul 15 '15 at 14:18
  • Glad it worked out for you :) dynamic simply tells the ee tags not to look to the URL for things like categories and titles (used for easy permalinking ect), however the parse parameter is somewhat of a secret squirrle! It's not properly documented. – Blatant Jul 15 '15 at 17:38

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.