We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8168
    • 1,118 Posts
    Hi guys,

    Is it possible to use getResources (which is a fab tool btw! Much better than Ditto!) to call a specified resource, rather than calling a resource from a container....

    E.g. I want to specify it to call ID 25... How would one do this? using &parents=’25’ does not work as that makes it look for resources to pull from inside resource 25...


    Any ideas?

    cheers,


    dubbs.
      • 8168
      • 1,118 Posts
      Doh! Just realised don’t use &parents but &resources instead and specify the resource id!

        • 11155
        • 74 Posts
        Well, that’s for the theory.
        In reality, it doesn’t work (for me):

        I have this structure...

        Res0 (1)
        |- Res1 (2)
        |- Res2 (4)
        |- Res3 (5)
        |- Res4 (6)
        |- Res5 (7)
        |- Res6 (8)

        I have 2 calls to GetResources on my page, the first one should retrieve the resources 2,4,5 and the second one should retrieve the resources 6, 7, 8:
        [[GetResources?
        	&parents=`1`
        	&resources=`2,4,5`
        	&includeContent=`1`
        	&includeTVs=`1`
        	&processTVs=`1`
        	&tpl=`someTpl`
        	&sortdir=`ASC`
        ]]


        [[GetResources?
        	&parents=`1`
        	&resources=`6,7,8`
        	&includeContent=`1`
        	&includeTVs=`1`
        	&processTVs=`1`
        	&tplFirst=`someOtherTpl.first`
        	&tpl=`someOtherTpl`
        	&tplLast=`someOtherTpl.last`
        	&sortdir=`ASC`
        ]]


        But both calls retrieve all the resources under (1) ! I tried with or without &parents, I tried different combinations for &resources, but I can’t get it to work :’-(

        Edit: no, even worse, I didn’t notice first but for some reason, it only retrieves 2,4,5,6,7 (not cool !? This is probably a different "bug".

        Edit2: I can’t change the "sortby" property in the property inspector of GetResources, I’m getting a list with two "invisible" items that will clear the property when selected (any), instead of toggling between ASC and DESC.
          • 8168
          • 1,118 Posts
          Try removing
          &parents=`1`
          from your snippet calls as you do not actually need it, resource IDs are unique so if you call resource 2,3 and 4 getResources does not need to know they are children of resource 1
            • 11155
            • 74 Posts
            As I said, I already tried with and without &parents !
              • 8168
              • 1,118 Posts
              Try changing you call from
              [[GetResources?]]
              to
              [[!getResources?]]
                • 11155
                • 74 Posts
                Same thing !

                About my first edit...
                it only retrieves 2,4,5,6,7 (not cool
                ...I found out the reason: property &limit has a default value of 5. I think it should be 0 so the user would have to specify a limit only when he needs, and not overwrite the value most of the time.
                  • 11155
                  • 74 Posts
                  Just to be sure: does anyone use the &resources property without the &parents ? How does it work for you ?
                    • 8168
                    • 1,118 Posts
                    Works fine for me!
                      • 11155
                      • 74 Posts
                      There is definitively something wrong: I finally succeeded to have it working the way I want by using &parents=`2` (or 4 or 5) for the first call and &parents=`6` (or 7 or cool for the second call ! That is that I have to use any value for &parents as long as it belongs to the list of resources I want to display, and not the parent itself !?