2

I am trying to filter a list by category, with each staff member listed beneath it. Here is my code:

{exp:channel:entries channel="offices" entry_id="23" dynamic="no"}
{office_staff}
    {exp:gwcode_categories entry_id="{entry_id}" style="linear" entry_count="yes" parse="inward"}
        {exp:stash:append_list name="city1_staff_{cat_id}" save="yes" scope="site"}
            {stash:title}{title} - {cat_id}<br/>{/stash:title}
        {/exp:stash:append_list}
    {/exp:gwcode_categories}
{/office_staff}
{/exp:channel:entries}

{exp:channel:categories channel="staff" style="linear"}
<h2>{category_name} - {category_id}</h2>
<ul>
    {exp:stash:get_list name="city1_staff_{category_id}"}
        <li>
            <h3>{title}</h3>
        </li>
    {/exp:stash:get_list}
</ul>
{/exp:channel:categories}

The categories are listing properly, and looking at mustash, it looks like the lists are being generated correctly, but for some reason the stash get_list isn't populating in the second code block. I am sure it is something simple, but its got me going in circles. Maybe someone has a clear view of it?

2

Top of my head, its a parse order thing. Try wrapping your exp:categories tag with

{exp:stash:parse process='end'}{exp:categories}...{/exp;categories}{/exp:stash:parse}

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.