Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

exclude specific catagories?

Quote Reply
exclude specific catagories?
I need to be able to exclude a root category and all it's children from the pool of categories a user may add links to.

What I'm intending to do is after validation, the link is then automatically added to additional categories based on certian criteria in the form input. I can't allow any of those categories to be directly added to as it would break my plugin (by adding links to date based categories for with the event does *not* occur on). I know that can grep out the unwanted selected categories with a PRE hook on handle_add, but that's not really the method I want to go with, since the categories will still appear in the submission form.

I know that somewhere I need to do something like:

Code:
<%if ID != $EventCalendar.root_cat_id or CatRoot != $EventCalendar.root_cat_id%>
normal code here
<%endif%>

($EventCalendar.root_cat_id is the root category of my automated category listings)

What's the best way to do this? I'd really prefer to use a a plugin hook to overide the standard selection lists, rather than a template hack in include_form.html, if possible.

Thanks

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy logic] exclude specific catagories? In reply to
Currently, I don't think there's an easy way of doing this as there are a few places that need hooks added. When I get some time, I'll have to take a look and see where we should add these hooks.

Adrian
Quote Reply
Re: [brewt] exclude specific catagories? In reply to
Thanks. I feel some built in filtering capability would be great to have in addition to plugin hooks though.

Right now I'm thinking about simply requiring the user to browse to the category instead of using AJAX or the select list. This way I can more easily enforce allowed categories via a global and a handle_add hook.

Philip
------------------
Limecat is not pleased.