Fork me on GitHub

filter by categories - how to include subcategories?  Bottom

  • I finally found out how to filter elements by categories. I needed this for the Content module, to sort articles.

    Code

    index.php?module=Content&func=list&cat=cid
    (For cid fill in the category's ID)

    It seems this was never mentioned in any docs, so I updated the Wiki page. There is a problem though: Only one category is listed, subcategories are not included. Since no docs regarding this issue exist, could the developers perhaps shed some light onto this? My problems:

    How can I include subcategories in such a filter?

    How can I filter by more than one category?

    icon_confused

    --
    And out of the chaos sounded a voice and spoke: "Be happy and smile, for it could have come worse."
    And I was happy and smiled - and it came worse...
  • Bumpidybump...

    Nothing?

    Nobody?

    --
    And out of the chaos sounded a voice and spoke: "Be happy and smile, for it could have come worse."
    And I was happy and smiled - and it came worse...
  • Hi!
    well, to include subcategories is a work to implement in Content. In News, you can check the pnuser.php file, from line 302 to 312.

    To filter more than one category is an issue that can be implemented with a new parameter like: func=list&cats=cid1:cid2:...:cidn and loop them... a little heavy IMHO

    Greetings icon_wink

    --
    - Mateo T. -
    Mis principios... son mis fines
  • nestormateo

    well, to include subcategories is a work to implement in Content. In News, you can check the pnuser.php file, from line 302 to 312.

    Hmm, so I probably can put this in myself, I suppose... But shouldn't something like this be generally available? I really like the category concept, mainly for the reason that it allows to assign a membership in multiple categories, not just one topic as in PN.

    For the same reason I also like the idea of subcategories. But I get the feeling that categories are not yet used to the extent they could serve. Couldn't such filtering code perhaps be put into a hook, so it does not need to be implemented into every module? Just a thought...

    Quote

    To filter more than one category is an issue that can be implemented with a new parameter like: func=list&cats=cid1:cid2:...:cidn and loop them... a little heavy IMHO

    So, this is not (yet?) possible? I wouldn't need to go through dozens of categories, but being able to list content of two or three major categories (preferably with subcategories included) would be nice indeed. I guess I have to file a feature request then...

    At least I know now how things are standing. Thanks for the clarification, Mateo!

    --
    And out of the chaos sounded a voice and spoke: "Be happy and smile, for it could have come worse."
    And I was happy and smiled - and it came worse...
  • 0 users

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