ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Hide Categories when nothing in them

July 29, 2008 9:11pm

Subscribe [1]
  • #1 / Jul 29, 2008 9:11pm

    redmercer

    35 posts

    Hi there,

    I am using Categories as links in a sub-nav. Here’s the code:

    {exp:weblog:categories weblog="mainentry" style="linear" show="1|2|3|4"}
    <a href="http://{path=byType}">{category_name}</a>
    {/exp:weblog:categories}

    This works great, except for when there is no entry in a particular category. When there is no entry, the Category still shows up (of course), but the link is screwy, because it has nothing to link to. How do I set it up so if a Category has no entries, it is hidden? But as soon as I publish something in that Category, it shows up. Is that possible?

    Thanks!

  • #2 / Jul 29, 2008 9:45pm

    Pascal Kriete

    2589 posts

    Try the show_empty parameter 😊 .

  • #3 / Jul 30, 2008 1:13pm

    redmercer

    35 posts

    Ack! Yes! I love it when it’s that easy! Thanks much!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases