Fork me on GitHub

Categories - basic approaches, hints and tips  Bottom

  • My experience with categories as far back as PostNuke 0.7 has been a mix of wow and damn. Wow because they can make some great things happen, and damn because it isn't always easy or obvious how to use them until too late. So I thought I'd start a pretty open-ended thread here with a bit of general info and some starter issues in the hope that people will contribute options or suggestions which I will then collate and organize and add to the Wiki.

    Seems as if Zikula 1.2 starts with:
    Root
    • +General (with Gender, Activity, etc)
    • +Modules
      • +Global (with a bunch or ready to use categories which you may use as is or modify)

    • +Users (not sure how and where this is useful)


    Some modules (News, Pages) create a category at the level of Global in +Modules. Some (PageMaster/Clip) suggest that you add categories in a specific place/format or a specific function like lists. A few (? mostly older) modules seem to ignore categories and use only their own internal categories. (Downloads and Links?)

    Some things for people to discuss might include:
    • If you want a set of content related categories that function across your site, do you use/modify the preloaded Global categories or start a new collection labeled something like +Content?
    • If you start a new +Content set, what are the advantages/disadvantages of putting it under Modules versus at Root?
    • Are there any ways to get things like Links and Downloads to use the Zikula category framework rather than their own independent category system?
    • Are there ways to make modules like News or Pages use a category with subcategories as a set of checkboxes or radio buttons or a drop down (like Pagemaster/Clip)?
    • What are the best approaches for filtering by category or subcategory in different modules?
    • What are different approaches to making different permissions for categories?


    If users have hints or tips or approaches that have worked well for using categories, please post about it here (preferably with some info about which modules your method works with). Questions I haven't asked (and answers to questions I haven't asked) would also be appreciated.

    Pretty open-ended, I know. But I will try to digest it and add the responses to the Wiki.

    Peter

    --
    Peace
    ______________________________________
    The commonest cause of problems is solutions.
  • Quote

    +Users (not sure how and where this is useful)

    The category module supports user-owned (ie: user-specific) categories. I wrote this about 3 years ago but have never used that feature. Typically you can ignore this.

    Quote

    If you start a new +Content set, what are the advantages/disadvantages of putting it under Modules versus at Root?

    None. The categories module doesn't care where you put things; this is just a semantic distinction to allow you to easily determine which categories are general and which are specific to a module.

    Quote

    Are there ways to make modules like News or Pages use a category with subcategories as a set of checkboxes or radio buttons or a drop down (like Pagemaster/Clip)?

    AFAIK the answer to this is "no" because there is no support for recursive category search in the core module/category handling code. Pagemaster/Clip implements it's own search code in order to achieve this.

    Greetings
    R
  • What exactly do you mean with:

    pheski

    Are there ways to make modules like News or Pages use a category with subcategories as a set of checkboxes or radio buttons or a drop down (like Pagemaster/Clip)?


    Where would you like the list or dropdown to appear then? You can already assign multiple categories to a News message. Content is using the zk categories these days, with version 3.2.0 you can assign the category property (or properties) that contains the category list.

    The permission strategy should be more or less the same if the permission scheme of the Category module is being used. News does it that way.

    --
    campertoday.nl, Module development, Dutch Zikula Community
  • [quote=espaan]What exactly do you mean with:

    pheski

    Are there ways to make modules like News or Pages use a category with subcategories as a set of checkboxes or radio buttons or a drop down (like Pagemaster/Clip)?


    With PageMaster/Clip one creates a category item with sub-category items that form a list, and then one can use this list to populate a drop-down (pick one), radio button (pick one) or check boxes (pick many). If I understand rgasch correctly, this depends on Clip-specific search code that performs first a search for the top category and then recursively within that category for the sub-items. So this approach will only work in a module that builds its own recursive search.

    To be specific, in Clip a publication can be tagged with more than one category from the list. Is it possible to use categories this way in News to tag an article with multiple categories?

    --
    Peace
    ______________________________________
    The commonest cause of problems is solutions.
  • multiple categories can be thought of in two ways.

    consider this category structure:

    root
    +HeadA
    +-SubA1
    +-SubA2
    +-SubA3
    +HeadB
    +-SubB1
    +-SubB2
    +-SubB3

    So, when you say 'multiple categories' you can either mean:
    1) choosing multiple subcategories within one head (e.g. SubA1 & SubA2)
    or
    2) choosing multiple subcategories within different heads (e.g. SubA1 & SubB2)

    this distinction is often lost in discussions like this.

    IN News, PostCalendar and probably Content (haven't tested), you can currently do #2 (SubA1 & SubB2) by adjusting the Category Registry and assigning multiple head categories to the module table.

    the #1 option above is not available in News, PC, ect because it requires a multiple-select box which is not typically used.
  • The biggest problem with multiple categories that I have noticed from my very limited attempts at their usage from the user side, and knowledge of their programming, is, module support and the templates invoking the categories as a drop list. A selection list would allow for an array response that the 'multiple' would imply where a drop list does not, if I understand it correctly. I have not explored what support there is in modules for the array response to category selection. e.g. the question: Which modules support multiple categories?

    So if we know the list of which modules support multiple categories; how and why are you going to use them? What will you accomplish? (or is this just a brain dead question from me, and I am missing something really simple? - please let me know.)
  • Quote

    how and why are you going to use them? What will you accomplish? (or is this just a brain dead question from me, and I am missing something really simple? - please let me know.)


    If I understand you right, my Church's site is a prime example, because I use Multiple Categories for PostCalender and News. Each group in our Church (Men, Women, Music, Teens, Kids, etc) has a category. Each group also has a page, created with Content. In the group pages, I have news and events displayed that are relevant to that group. Well, let's say, in October, the Kids and the Youth are going to do a Corn Maze (Which they do). I categorize the news item about it to Kids and Youth, and the Event for it the same way, when you go to the Kids page, you see it listed, ditto the youth page, as well as the master list on the home page.

    --
    Home Page | Find on Facebook | Follow on Twitter
  • Quote

    The biggest problem with multiple categories that I have noticed from my very limited attempts at their usage from the user side, and knowledge of their programming, is, module support and the templates invoking the categories as a drop list.


    From memory, the Quotes module uses multiple selectors for this.

    Using multiple categories is easy if you write the code to handle this yourself. It becomes not-so-trivial when you want the core to do everything for your automatically; support for this was added to the Quotes module but I don't think it was added to any other modules. The core implementation of categories also suffers from the defect that it does not support recursive category lookups. This should at some point be added but so far neither Mateo or myself seem to have found the time to do so.

    Greetings
    R
  • News and Content and I think Postcalendar as well also can use multiple categories if appointed in the category registry.
    If you set it in the cat-registry then multiple selectors will be shown.

    --
    campertoday.nl, Module development, Dutch Zikula Community
  • again - icon_smile - see my post above. News, Content and PC can do multiple categories under different heads. NOT multiples in the same head.
  • Sure that is what I meant as well. It gets confusing quite fast. Does Quotes support multiple cateogies in the same Head? I dont use the quotes module, so dont know how it looks and how the code is done.

    --
    campertoday.nl, Module development, Dutch Zikula Community
  • Quote

    Does Quotes support multiple cateogies in the same Head? I dont use the quotes module, so dont know how it looks and how the code is done.


    From memory: yes (I know/remember this because I added support for this as a demo for the capabilities of the categories module).

    Greetings
    R
  • rgasch

    Quote

    Does Quotes support multiple cateogies in the same Head? I dont use the quotes module, so dont know how it looks and how the code is done.


    From memory: yes (I know/remember this because I added support for this as a demo for the capabilities of the categories module).

    Greetings
    R


    From what I understand Categories does not support this: http://code.zikula.org/core/ticket/1739.
  • Quotes supports multiple categories using the core system for this, due to the deficiencies of the core, it does not support nested categories.

    Greetings
    R
  • Quotes, like news, supports filtering on multiple categories 'in the same head'. It does not support assigning multiple category values in the same head. The categories system itself does not support this. http://community.zik…ewtopic&topic=57513 http://code.zikula.org/core/ticket/1739

This list is based on users active over the last 60 minutes.