Category Menu - If Parent Category is marked as Hidden don't show Child Categories

5 posts by 2 authors in: Forums > CMS Builder
Last Post: October 23, 2013   (RSS)

By Steve99 - October 17, 2013

Hello,

I have a dev site that I'm utilizing the Category Menu for. I've added the system field of "hidden".

If I mark a Parent Category as hidden, I want all Child Categories to then be hidden as well as we'd essentially be disabling a site section (without having to go through each Child Category to hide).

Is there a default option that can be set to achieve this? If not, I suppose I could use the "record_postsave" hook for a plugin.

Thank you in advance.

Regards,
Steve

By ross - October 17, 2013

Hi Steve

Thanks for posting!

There isn't a built in option to change all child categories to hidden if the parent is hidden. Like you mentioned, this could be done with a plugin that hooks in at "record_postsave". Is this something you'd like a hand with through consulting? Or are you ok on your own with it? We wouldn't be able to offer too much support if you do it on your own but we'll do everything we can :)

Let me know what you think :). Thanks!

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

By ross - October 22, 2013

Hi Steve

Great plugin. Thanks for sharing it!

There isn't anything on the front end either to hide children of a hidden parent category so I think the plugin is probably the best way to do it. There is of course a way to code this all up on the front end but it will take a lot of work. There is less code over all doing it with a plugin :).

Does your plugin handle un-hiding children when you un-hide their parent? Or is that not a requirement?

Thanks!

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

By Steve99 - October 23, 2013

Hi Ross,

Sure thing!

Yes, it does un-hide children when you un-hide their parent. I think that when I revise this plugin I'll add an alert for if a parent is going to be un-hidden to give the user the option to un-hide all children just in case they don't want to reactivate all of them. That would give the user flexibility to reactivate children on a per child basis. I should probably put in an alert for when a user goes to hide a category as well just to reinforce that it's effectively disabling an entire site section with the option to continue or cancel.

I'll post another version when I update and refine this one. We have CMS installs going back to v1 series so I plan on testing this on more versions. From initial review, it should work with all in the v2 series but I want to test before making any statements. 

Cheers,
Steve