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.

Help with Conditionals for dynamic sub navigation

June 05, 2008 8:29pm

Subscribe [2]
  • #1 / Jun 05, 2008 8:29pm

    Corey Lane

    34 posts

    I’m using the weblog:category_archive tag to dynamically generate sub-navigation for an EE site I’m working on.

    This is working great, but I only want to display this code if there are entires in the category. For example, if the category has no entires in it, this should not be displayed. I’m assuming I’ll need to wrap the below code in some sort of conditional for this, but after looking in the docs I’m just not sure how to do it.

    ‘if category entires > 0 display this code’ - if only it were that easy 😛

    I should also mention I’m using this on static type pages, not on a blog/archive page.

    <ul class="subnav-menu">
          {exp:weblog:category_archive weblog="ministries" style="linear" show_empty="no" show="18" orderby="title" sort="asc"}
          {entry_titles}
          <li><a href="http://{path=ministries/sos}">{title}</a></li>
          {/entry_titles}
          {/exp:weblog:category_archive}
        </ul>

    Any help/ideas are much appreciated!

  • #2 / Jun 05, 2008 9:36pm

    Sue Crocker

    26054 posts

    Corey, see the show_empty=“no” ? Is that not working for you? You’re also putting in show=“18” so you’re saying show category 18?

    Looks like you’ve been trying a few things…

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

ExpressionEngine News!

#eecms, #events, #releases