We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11155
    • 74 Posts
    I applied the changed suggested here: http://modxcms.com/forums/index.php/topic,52337.msg306699.html#msg306699
    and now it works as expected.

    Looks like a bug !?
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: GoustiFruit at Oct 15, 2010, 02:53 AM

      I applied the changed suggested here: http://modxcms.com/forums/index.php/topic,52337.msg306699.html#msg306699
      and now it works as expected.

      Looks like a bug !?
      No that post was trying to get it to work other than how it was intended to. If you specify parents and resources, it will combine the results (i.e. all the children of the indicated parents + any resources specified either included or excluded from the results selected by the parents).
        • 36686
        • 165 Posts
        I got this working fine:
        [[getResources? &resources=`12,10` &tpl=`puff` &includeTVs=`1` &includeContent=`1`]]


        Now two questions:

        1. How can I get it to order the output by the order in which I enter the resource id’s (i.e. first show 12 then 10)?

        2. Is there any way the same resource can be displayed twice, i.e. 10,12,10?
          • 8168
          • 1,118 Posts
          lottaar - you can see all the resource options here - http://rtfm.modx.com/display/ADDON/getResources

          To list via menuindex order add in this to your call - DESC will show them in descending order, ASC will show them in ascending order.

          &sortby=`menuindex` &sortdir=`DESC`


          if menuindex does not work use ID
            • 11155
            • 74 Posts
            Quote from: OpenGeek at Oct 16, 2010, 02:36 PM

            No that post was trying to get it to work other than how it was intended to. If you specify parents and resources, it will combine the results (i.e. all the children of the indicated parents + any resources specified either included or excluded from the results selected by the parents).
            Maybe but if you specify only a list of resources without a parent, it won’t retrieve the selection !
            Well, as I didn’t want to modify the source each and every time the GetResources would be updated, I finally decided on grouping the needed resources under a sub-container. But I’m sure there is something wrong with GetResources undecided
              • 8386 ☆ A M B ☆
              • 160 Posts
              I have exactly this same issue with getResources version 1.1.0-pl, Ditto had an option to call resources only without parents involvement so this would be ideal if getResources is suppose to be a replacement for Ditto. This is problem I am currently having trying to port a site from evolution to revolution.
                • 8386 ☆ A M B ☆
                • 160 Posts
                Quote from: easylancer at Oct 20, 2010, 05:14 PM

                I have exactly this same issue with getResources version 1.1.0-pl, Ditto had an option to call resources only without parents involvement so this would be ideal if getResources is suppose to be a replacement for Ditto. This is problem I am currently having trying to port a site from evolution to revolution.

                Ok i got this to work by setting &parents=`1` and the &resources=`4,2,3,22` to the values I was looking for. It is rather strange that I have to set the &parents to 1.
                  • 36686
                  • 165 Posts
                  easylancer & GoustiFruit - I got it working without &parents, but only after upgrading to getResources 1.2.2 (MODx Revolution 2.0.4-pl).

                  dubbs - I don’t want to sort by menuindex, but by the order in which the resources are entered in the getResources call. Maybe I should explain what I’m trying to achieve: I’m using getResources in my template, and a tv to specify which resources to show (i.e. &resources=`[[*docsToShow]]`). I then want to be able to on each page on the site show different resources, in different order, by entering the resource id’s comma separated in the template variable (1,2,1,5,1,3 etc.).
                    • 15022
                    • 31 Posts
                    Just wanted to add my experience in here too. The &resources parameter (used inclusively) only works for me if I set &parents=`1`. Thanks for this thread. I finally got this working.
                      illegitimati non carborundum
                      • 36686
                      • 165 Posts
                      For some reason &resources works without &parents for me in one of my templates, whilst in another it doesn’t. The call is identical!

                      For now I’ll have to go back to using Ditto, but it would be great if there could be a fix for this in the near future, and also the ability to sort the resoures in the order of being entered, plus being able to show a resource more than once, if it’s not too much to ask wink