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.

Define certain content dependent on category group

May 23, 2012 1:34pm

Subscribe [2]
  • #1 / May 23, 2012 1:34pm

    Scott Harrington

    85 posts

    Hello, Im trying to utilise a generic template that displays info from posts. The majority of the content displayed is via the post along with some static content.

    What I would like to achieve is display different notes based on category.

    Below is what I have tried but it displays a PHP error when trying to render:-

    {if category_group="30"}
    Content that relates to this category
             
    {if:else}
    Generic content which relates to the rest of the categories
    {if}

    Any idea what I’m doing wrong here?

    Your help would be greatly appreciated.

    PS I know the simple solution would’ve been to include a field within the channel entries, however this is additional content that needs adding (and has since been decided after the build) and there are nearly 2000 entries, meaning manually amending each one ;(

  • #2 / May 23, 2012 3:06pm

    ChiefAlchemist

    913 posts

    Persuming that content is going to come from another channel and presuming that category is passed in a segment, then I would use Low’s Seg2Cat.

    I’m not sure what or why that error is. But maybe it doesn’t matter?

    That said, check for your ifs being closed properly. A PHP error usually means a parsing issue.

  • #3 / May 28, 2012 4:16pm

    Scott Harrington

    85 posts

    Thankyou, great help 😉

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

ExpressionEngine News!

#eecms, #events, #releases