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

    I’m trying to get getResource to work but can’t for the life of me get it to output anything at all.

    My Call:
    [[getResources? &parents=`[[*10]]` &tpl=`list`]]


    In my list chunk I have:
    [[*pagetitle]]
    [[*content]]

    And there are 6 pages under page 10 that are published but not shown in menu.

    As I say the above returns nothing at all, as I missing something ??

    Cheers
      • 1778
      • 659 Posts
      Hello

      Did you try
      [[getResources? &parents=`10` &tpl=`list`]]
      


      You should give the ID of the resource to the &parents parameter, you give it the value of "[[*id]]" only if you want the &parents parameter has the value of the current resource (given by [[*id]])

      Hope this works
      Cheers
        • 22840
        • 1,572 Posts
        Hi anso,

        Yeh it tried that and [[*id]] but nothing at all is output, have cleared the cache, flushed everything.

        The call is being added to the page content but that shouldn’t matter should it.

        Have also tried the following in the chunk but still no results are being output:

        [[+pagetitle]]
        [[+content]]


        Cheers
          • 1778
          • 659 Posts
          Maybe a problem with your Tpl ? Did you try without specifying a &tpl parameter ?
          Cheers
            • 22840
            • 1,572 Posts
            Hi,

            Yeh tried that, also tried [[getResources?]] and doing all the calls uncached and still nothing huh
              • 22303 MODX Staff
              • 10,725 Posts
              If you remove the tpl parameter, you should get the raw output of whatever Resources are selected by your configuration of the Snippet.
                • 22840
                • 1,572 Posts
                Quote from: OpenGeek at Jul 18, 2010, 01:58 PM

                If you remove the tpl parameter, you should get the raw output of whatever Resources are selected by your configuration of the Snippet.

                Hi OpenGeek,

                I’ve tried [[getResources? &parents=`10`]] and [[getResources? &parents=`[[*id]]`]] also the un cached versions and nothing is being out put at all.

                  • 22840
                  • 1,572 Posts
                  Sorted,

                  I added &showHidden=`1` and it worked. Didnt know about that lol

                  Thanks everyone
                    • 26647
                    • 12 Posts
                    i’m testing it too, is it normal i’m just getting an array shown on the page??
                      • 28215
                      • 4,149 Posts
                      Quote from: sennevb at Jul 18, 2010, 06:34 PM

                      i’m testing it too, is it normal i’m just getting an array shown on the page??
                      Yes, if you don’t specify a &tpl.
                        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com