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.

Category Archive Conditional

May 15, 2009 6:34pm

Subscribe [1]
  • #1 / May 15, 2009 6:34pm

    techops

    18 posts

    Can I create a conditional that says if there are more than 1 entry in a particular category, then list out the titles, otherwise just print the category name?

    Here’s my code so far:

    {exp:weblog:category_archive weblog="{my_weblog}" style="nested" class="nav main"}
        {categories}<a href="http://{path=weblog/index}">{category_name}</a>{/categories}
        {entry_titles}<a href="http://{path={my_template_group}/comments}">{title}</a>{/entry_titles}
    {/exp:weblog:category_archive}

    I would prefer it not to print out the entry title if there is only 1 entry in the category.

    So:

    Category 1
    -Entry 1
    -Entry 2
    -Entry 3
    Category 2
    Category 3
    -Entry 4
    -Entry 5
    -Entry 6

    Thanks!

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

ExpressionEngine News!

#eecms, #events, #releases