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.

entry has category?

January 04, 2012 1:25pm

Subscribe [2]
  • #1 / Jan 04, 2012 1:25pm

    oltremedia

    28 posts

    Hi a simple question for you Guru’s

    I want to check if an entry has a selected category and I’m doing this but when the entry has no category it doesn’t show the text “no-category

    i did this…

    {categories}{if category_name != ""}{category_name}{if:else}no-category{/if}{/categories}

    and this…

    {categories}{if category_name != ""}{category_name}{if:else}no-category{/if}{/categories}

    is there maybe something like has_category ???

    bye!
    Francesco

  • #2 / Jan 05, 2012 11:52pm

    Try using {total_results} and testing against that.

  • #3 / Jan 06, 2012 10:02am

    We’ve used this plugin to solve this problem: http://devot-ee.com/add-ons/bw-category-count

  • #4 / Jan 09, 2012 9:42am

    oltremedia

    28 posts

    Thankyou guys!
    I’ll give it a try!

    bye
    Francesco

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

ExpressionEngine News!

#eecms, #events, #releases