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.

Strange categories behavior: parents and children

April 24, 2012 2:07pm

Subscribe [1]
  • #1 / Apr 24, 2012 2:07pm

    Intersindical

    5 posts

    We noticed a strange and annoying behavior when assigning categories to entries in a channel.
    It is a channel that is a legislative repository consisting of 94 categories grouped alphabetically, so there are 25 categories with a different number of child categories each.
    We have created a unique dynamic template to show the entries in each child category, and another index template showing categories alphabetically grouped under the parent category.
    Now comes the problem: if the entry has been created and categorized after creating the parent alphabetical category, the page that displays the entries in this child category shows both categories, parent and child, even if we use the conditional.

    {categories}
         {if parent_id != '0'}
          {category_name}
         {/if} 
        {/categories}

    For example, for a given entry belonging to the category “Education” also shows the parent category “E”.
    Conversely, if the parent category has been created after alphabetic categories children, this does not happen and shows only the child category by means of the conditional use.
    But when creating a new entry in a category that already belongs to a parent category, that takes both the parent and child category, even when using the former conditonal.
    Any help is welcome.
    Many thanks in advance for your attention.
    Amadeu Sanz
    Intersindical Valenciana

  • #2 / Apr 25, 2012 12:34pm

    Dan Decker

    7338 posts

    Hi Amadeu,

    I’m sorry for the trouble this has caused for you!

    It’s easy enough to sort out. Go to Admin->Channel Administration->Global Preferences check “Auto-Assign Category Parents”. You want that to be set to “No”.

    Cheers!

  • #3 / Apr 25, 2012 1:34pm

    Intersindical

    5 posts

    Hi Dan.
    Thanks for your reply and advice. That was the problem, indeed. Now everything is working fine.

  • #4 / Apr 26, 2012 2:31pm

    Dan Decker

    7338 posts

    Hi Amadeu,

    Excellent! Glad to see you are all sorted out.

    If we can help in the future, just open a new thread.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases