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

    I am just getting used to Revolution (and I am so far very impressed!)

    I do have an issue with using the getResources function though... maybe i am getting something wrong...

    [[getResources? &parents=`4` &tpl=`test`]]


    The `test` chunk simply has the following HTML (to test the function)

    <p>test</p>


    I would expect getResources to print out test for each resource that exists under the resource with ID `4` (there are 5 resources that have resource ID 4 as a parent)

    so I would expect the following output...

    test
    test
    test
    test
    test

    But nothing is printed! I have installed getResources using the Package Manager... Is there some other config i have missed?

    Please help!

      • 33987 ☆ A M B ☆
      • 197 Posts
      That should totally work. I tried your snippet call + chunk and it worked.

      So:
      - is test really a chunk, and not accidentally a snippet?
      - did you write getResources or GetResources
      - did you install getResources, not only downloaded it?
      - Is there actually anything in the folder with ID 4, which is published?
        Sterc Internet & Marketing | MODX Founding Partner | Chairman of the MODX Advisory Board

        In need of a MODX consult? Try our MODX Developers Experts!
        • 14605
        • 40 Posts
        hmmm this drove me crazy last night as I was sure it should work....

        -its definitely a chunk
        -getResources?
        -downloaded and then used the local install process within package manager
        -I am certain there are 5 resources that have ID4 as the parent ID

        I will have a look at this tonight with fresh eyes...

        Thanks for testing this out for me
          • 28215
          • 4,149 Posts
          splittingred Reply #4, 16 years ago
          - Do the Resources have ’Hide from Menus’ checked?
          - Are they containers?
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 14605
            • 40 Posts
            not sure about ’Hide from menus’, I shall check this when i have access to my dev machine tonight...

            How do I check if a resource is a container?
              • 28215
              • 4,149 Posts
              splittingred Reply #6, 16 years ago
              If it has "Container" checked.
                shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                • 14605
                • 40 Posts
                ahh!! Sorry for obvious question, just don’t have modx env in front of me right now...

                Does a resource have to be marked as container to ensure the child resources are picked up by the getResources function?
                  • 28215
                  • 4,149 Posts
                  splittingred Reply #8, 16 years ago
                  Not, but there is a &hideContainers option.
                    shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                    • 14605
                    • 40 Posts
                    I shall post more on this tonight, thanks for your help thus far laugh
                      • 14605
                      • 40 Posts
                      I have finally solved this... Schoolboy error... The child documents were not published! Silly mistake = 4 hours wasted...

                      Thanks you for your help