I’ve got a page where I’m posting links to the groups that a user has access to based on Member Categories. Before, I just used the {exp:member_categories:categories} loop and it worked fine, but there was no organization to the way the list was displayed and it was just a long random list of links. So I’m trying something different and running a separate {exp:member_categories:check} for each of the categories, broken down into logical groups. Not the most efficient, I know, but it’s only on one page (and I can technically cache it when it’s done).
Anyway, the only problem is that I can’t give a single “you do not belong to any groups” if they don’t belong to any groups. If I do a {if no_results}, then I get that for each category that it checks. And I don’t really want that.
I was going to try to use Stash to set some sort of value to an append_list, then check that at the end. However, it’s not working. I have tried both of the following, setting a value of “1” so that I could check for “is_empty” later.
{exp:stash:append_list name="group_list" process="end"}
{exp:member_categories:check category_id="113"}
<p><a href="/members/groups/sample-group">Sample Group</a></p>
{stash:item_link}1{/stash:item_link}
{/exp:member_categories:check}
{/exp:stash:append_list}
and
{exp:member_categories:check category_id="113"}
{exp:stash:append_list name="group_list" process="end"}
<p><a href="/members/groups/sample-group">Sample Group</a></p>
{stash:item_link}1{/stash:item_link}
{/exp:stash:append_list}
{/exp:member_categories:check}
I’m not sure if this is even possible? Or are there any other options?