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.

Using conditional for category

July 01, 2013 12:21pm

Subscribe [2]
  • #1 / Jul 01, 2013 12:21pm

    Argyll

    67 posts

    What I’m doing seems like it should be so simple..but I can’t get it to work.

    Showing news entries on a page using a channel entries tag.  If the entry has a summary tag, show this formatting. If the entry has this category, show this formatting.  Finally, if the above are not true, show this formatting.

    {exp:channel:entries channel="news" entry_id="not 3084" orderby="date" sort="desc" limit="10" paginate="bottom" disable="member_data"}
    {if news_summary}
    Show this stuff
        
    {if:elseif category == 28}
     Show stuff this way
    
    {if:else}
    None of the above must be true!
     {/if}

    The problem is that “category 28” items are not showing up the correct way..they are showing up as the last conditional.

  • #2 / Jul 01, 2013 1:34pm

    Jeremy S.

    353 posts

    Maybe try:

    {if:elseif segment_x == "category_name"}
     Show stuff this way
  • #3 / Jul 01, 2013 2:08pm

    Argyll

    67 posts

    Not sure I follow. This page just lists news entries without using url segments.

  • #4 / Jul 01, 2013 2:58pm

    Argyll

    67 posts

    Is the problem that the advanced conditional is parsed after the outside channel entries tag?

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

ExpressionEngine News!

#eecms, #events, #releases