• How to list only tags which are used by a certain subset of resources?#

  • Michael van Laar Reply #1, 3 months, 4 weeks ago

    Reply
    Hi folks,

    I’m searching for a solution to make tagLister display only a certain subset of tags. Two groups of resources (which can be distinguished by their different templates as well as their different parent resources) share the same TV for tags. Now I want to be able to display a tag list for each of the two groups. To be more specific: I want a list of only those tags which are assigned to at least one resource in the group of resources i manually specify. So if tag “XYZ” is not used by any “group 1” resource, it should not show in the “group 1” tag list.

    I know, if I had a decent amount of PHP and MySQL knowledge I could develop something to solve this problem. But perhaps someone of you had a similar challenge and knows a simple solution.

    Thanks for any advice!
    Michael


  • Mark Hamstra - MODX Complete Team Reply #2, 3 months, 4 weeks ago

    Reply
    [[tagLister? ... &parents=`3,5,6`]]
    


    Updated the docs to make sure that is listed.


  • Michael van Laar Reply #3, 3 months, 4 weeks ago

    Reply
    Wow! That’s indeed a simple solution :-) Thanks so much!


  • Mark Hamstra - MODX Complete Team Reply #4, 3 months, 4 weeks ago

    Reply
    Most (if not all at least core developed addons, and a large number of community ones too) have support for stuff like that. If it's not documented, you can check the "Properties" tab to see if there's any hints there, or look through the first bit of the PHP for pieces of code like this:

    $something = $modx->getOption('something',$scriptProperties,..);
    

    That indicates it is looking for a "something" property, and, when named properly, that should be reassurance something is possible after all!
    Oh, and of course make sure to post your findings of undocumented properties at http://bugs.modx.com/projects/docs/issues so someone with access to it can update it, and save someone else the trouble next time