Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
- mdee created topic »How to implement returnpage ?« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Multiple Categories per Module
-
- Rank: Registered User
- Registered: Jan 28, 2006
- Last visit: Jan 22, 2008
- Posts: 14
When I was looking at the Category Registry part of the Categories module, I was under the impression that 'Property Name' was there so you can have multiple categories per module (ie, a custom module having one category selector box for the "Global" choices and another category selector box for "ActiveStatus" choices). However, the way the categories_mapobj table is set up does not take Property Name into account. Am I misinterpreting the use of Property Name? If I am, what is that field for and will there eventually be a way to have multiple categories per module? If I'm not, am I missing the way to have multiple categories or is there a fix on the way? -
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
I guess you can take a look to the 'Quotes' Value Addons module.
I see that each item supports many categories. But yes, trying to implement something with multiple categories, i still don't know how to identify the respective field (may looking at the parent category, but it's not good) if the property name is not used by CategoryRegistry.
--
- Mateo T. -
Mis principios... son mis fines -
- Rank: Registered User
- Registered: Jan 28, 2006
- Last visit: Jan 22, 2008
- Posts: 14
There definitely has to be a way to implement the Property Name though. For example, lets say I am creating a module and I want each item to be classified under a "Global" category. However, I also want to use the "ActiveStatus" categories to determine whether or not that item is active or not. Or perhaps in the News module, instead of having a seperate field there for pn_published_status, why not just be able to use the "Pending Status Extended" categories? It's just not practical in many cases to look through every category an item is associated with and find the one who's Parent category is "ActiveStatus" or whatever. -
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
I can only talk in general terms here because I don't have code to hand, however when you send an object to DBUtil for an insert or update, the categories are specified as an array e.g:
'___CATEGORIES___' => array('1','2'),
So for multiple categories just add entries to the array.
--
itbegins.co.uk - Zikula Consulting
birtwistle.me.uk - Personal Blog
Please read the Support Guide -
- Rank: Registered User
- Registered: Jan 28, 2006
- Last visit: Jan 22, 2008
- Posts: 14
Inserting/Updating the categories isn't the problem. It's getting them (and just if it isn't clear, I'm not talking about selecting multiple categories within the same general group, but rather Categories from completely different sections of the Categories hierarchy).
So lets say I have a module with 4 category selector boxes ('Global', 'ActiveStatus', 'YesNo' and 'Pending Status Extended'). Now when I want to update an item in that module I need to specify a selected value for each selector box. Am I to search through all the selected categories for the one who's parent is 'Global' or 'ActiveStatus'? And what if the selected category is more than one sub-category down? Does that mean we have to search all parents, grand-parents, etc? I guess we could make it recursive, but in many cases that just isn't practical and to me isn't user-friendly.
If we have a field called Property Name (which to the best of my knowledge is not currently being used), why not use it to be able to distinguish different category boxes/types? Just my opinion though. It just seems a lot of the Categories API is quite difficult and far from what PostNuke usually does.
- Moderated by:
- Support
