We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5811
    • 1,717 Posts
    This is an auto-generated topic for GetIds 1.0-pl by coroico.

    Brief Description:

    A general purpose snippet to get a comma separated list of resource ids. Include / exclude parents and/or children resources id

    Use it with &resources (for getResources) or &documents (for ditto) or for any list ids parameter

    e.g: [[!getResources? &resources=`[[!GetIds? &ids=`c27,-c36`]]` &tpl=`blogPost`]]


    Usefull to define a list of ids for &resources parameter

    Examples:

    Include #18 and children of #18, exclude chidren of #21 but keep #34:
    [[!GetIds?  &ids=`18, c18, -c21, 34`]]

    Include all parents of #12, exclude parents of #3 but keep #2:
    [[!GetIds? &ids=`p12, -p3, -1, 2`]]

    Include #8 and children of #8, include parents of #3, exclude parents of #2:
    [[!GetIds? &ids=`18, c18, p3, -p2`


    IMPORTANT: take care of the order of arguments. To be excluded the id should be already in the list
    &ids=`18, 19, -19, 20` => ’18,20’ but &ids=`18, -19, 19, 20` => ’18,19,20’

    Here is a discussion about this snippet
      • 33337
      • 3,975 Posts
      This looks beautiful!

      Thanks!
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 31037
        • 358 Posts
        Nice!
          • 5811
          • 1,717 Posts
          GetIds 1.0.0 is compliant and compatible with revo 2.1