0

Long story short, I have a situation where categories are treated like channel entries as far as generating lists of content on the front-end (using gwcode_categories inside channel entries.) I have a user who would like to turn some of the categories off the way she's done with channels, setting statuses to Closed.

Is there a way I can give categories open/closed statuses without having to resort to custom SQL/PHP? I would be willing to pay for a premium plugin to add this feature.

This is on EE 2.8.1.

3

Custom category field?

enter image description here

Which defaults to open:

enter image description here

Then your template code:

{exp:gwcode_categories channel="example" depth="1" custom_fields="yes" linear="yes"}
    {if cat_status == "Open"}{cat_name}{/if}
{/exp:gwcode_categories}

Note the additional parameter custom_fields="yes".

| improve this answer | |
  • Thanks, Peter. Good thought. I was stuck making this work for a bit until I realized linear=yes would stop gwcode_categories from outputting default <li> tags, letting me nest them inside the if conditional. – Michael Jun 2 '16 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.