We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    This is an auto-generated topic for getResources 1.2.2-pl by opengeek.

    Brief Description:


    getResources 1.2.2-pl (October 18, 2010)

    • [[#19]] Fix sortbyTV returning duplicate rows
      • 13986
      • 90 Posts
      is there a parameter to show resources marked with "hide from menus"?
        Jeremy Foster
        • 28215
        • 4,149 Posts
        &showHidden=`1`
          shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
          • 17883
          • 1,039 Posts
          How do I filter by resources? I expected by using &resources to do so, but only the exclution works.

          Tree:
          - 25
          -- 56
          -- 57
          -- 58

          [[getResources? &tpl=`tpl_mitarbeiter_sidebar` &sortby=`menuindex` &sortdir=`ASC` &limit=`99` &resources=`57` &includeContent=`1` &tvPrefix=`` &includeTVs=`1` &showHidden=`1` &depth=`1` &parents=`25`  &processTVs=`1`]]


          Expected behaviour: Show only resource 57
          Result: All children of 25

          [[getResources? &tpl=`tpl_mitarbeiter_sidebar` &sortby=`menuindex` &sortdir=`ASC` &limit=`99` &resources=`-57` &includeContent=`1` &tvPrefix=`` &includeTVs=`1` &showHidden=`1` &depth=`1` &parents=`25`  &processTVs=`1`]]


          Expected behaviour: Show all children of 25 except 57
          Result: as expected

          So shouldn`t &resources only show the specified resources and filter out all others?

          Reason: I have a TV ’selection’ which gets the ids of a special parent, I want to use this selection for the getresources call:

          [[getResources? &tpl=`tpl_mitarbeiter_sidebar` &sortby=`menuindex` &sortdir=`ASC` &limit=`99` &resources=`[[*selection]]` &includeContent=`1` &tvPrefix=`` &includeTVs=`1` &showHidden=`1` &depth=`1` &parents=`25`  &processTVs=`1`]]


          The TV ’selection’ is correct implementend with outputfilter delimited list ",". So I only want to show these resources selected by that TV.
            • 17883
            • 1,039 Posts
            Okay, got it.

            Line 151:

            $criteria->orCondition(array('modResource.id:IN' => $include),null,10);


            should be

            $criteria->andCondition(array('modResource.id:IN' => $include),null,10);


            I am not sure, if this is by design or if this is a bug. If it is a bug, I will file it.
              • 22303 MODX Staff
              • 10,725 Posts
              This has been discussed before and is not a bug. If you set &parents to anything other than empty, it will return the logical AND of the parents and resources selection techniques. If you want only the resources you specified, set parents to blank.
                • 4971
                • 964 Posts
                Is there a way to mark the resources to rel=nofollow from the getResources call?
                  Website: www.mercologia.com
                  MODX Revo Tutorials:  www.modxperience.com

                  MODX Professional Partner
                  • 22303 MODX Staff
                  • 10,725 Posts
                  That would go in your tpl( s )...
                    • 4971
                    • 964 Posts
                    duh... thanks Jason..
                      Website: www.mercologia.com
                      MODX Revo Tutorials:  www.modxperience.com

                      MODX Professional Partner
                      • 37514
                      • 178 Posts
                      I’ve the following code:
                      [[!getResources?
                      &parents=`2`
                      &limit=`2`
                      &showHidden=`1`
                      &tpl=`ListTitleOnly`
                      ]]
                      This works in one MODx context, but not another. The same MODx template is being used. So it seems that getresources may be breaking when calling resources from another context?

                      I’m using 2.0.4