0

I have tried using category_group="4" to restrict the categories displayed in the channel entries tag to ONLY that category group, but it's still displaying from category_group 14 as well. I then tried category_group="not 14" to try and restrict it from displaying those categories, but it changed absolutely nothing.

My news entries use 2 category groups, and I need to restrict it to only display categories attached to the entry from category_group 4. I may just be missing something...but it shouldn't be this hard to only display from one group.

Here is the code I'm currently using, and trying category_group="4" didn't help either:

{exp:channel:entries status="open|Featured" channel="{channel}" category="{cat}" orderby="date" limit="10" paginate="bottom"}
        <article>
            <figure><img src="{image_upload}" alt="{title}" /></figure>
            <div>
                <h4>{title}</h4>
                <p>{entry_date format="%F %d, %Y"} | Filed under: {categories backspace="7" category_group="not 14"}<a href="{path=news/view}">{category_name}</a>,&nbsp;{/categories}</p>
                {if news_body}<p><a class="more" href="{title_permalink=news/view}" title="Read More"> Read More &raquo;</a></p>{/if}
            </div>
        </article>
        {paginate}<p id="pagination">{pagination_links}</p>{/paginate}
{/exp:channel:entries}

I would like to add that show="not 97|98|99" worked, as these are the exact categories in the group I would like to not show. I need a dynamic solution however, as these could be modified by the client in the future.

1 Answer 1

1

Actually, in the categories tag pair, inside exp:channel:entries, the parameter you want is the show_group.

{exp:channel:entries status="open|Featured" channel="{channel}" category="{cat}" orderby="date" limit="10" paginate="bottom"}
        <article>
            <figure><img src="{image_upload}" alt="{title}" /></figure>
            <div>
                <h4>{title}</h4>
                <p>{entry_date format="%F %d, %Y"} | Filed under: {categories backspace="7" show_group="4"}<a href="{path=news/view}">{category_name}</a>,&nbsp;{/categories}</p>
                {if news_body}<p><a class="more" href="{title_permalink=news/view}" title="Read More"> Read More &raquo;</a></p>{/if}
            </div>
        </article>
        {paginate}<p id="pagination">{pagination_links}</p>{/paginate}
{/exp:channel:entries}

category_group is a parameter of the exp:channel:categories tag pair.

2
  • It also supports the "not", so to suit your purpose: show_group="not 97|98|99" Jun 11, 2014 at 5:44
  • Thanks, show_group did the trick...I was obviously looking at the wrong categories documentation, lol. Jun 11, 2014 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.