We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6146
    • 48 Posts
    Hi everyone - been pulling my hair out with this one.

    MODx = MODX Revolution 2.2.1-pl (traditional)
    getResources = Version: 1.4.2-pl

    Very simple snippet that works in one template without an issues. It works on another template but spits out the Array of Attributes in addition to the results of the snippet.

    The snippet:
    [[getResources? &parents=`577` &limit=`0` &tpl=`county.maparea.tpl`]]


    The chunk:
    [[+introtext]]


    I've checked the snippet, the chunk and the template a dozen times. I'm not sure where to look next. Can someone please point me in the right direction?
    Thanks.
      • 6146
      • 48 Posts
      Sorry - forgot one detail that may matter.

      The only difference between the two places the snippet is used is the &parents. Everything else is the same.
        • 3749
        • 24,544 Posts
        That's really odd. AFAIK, GR only shows the attribute array if it can't find the Tpl chunk, in which case you wouldn't see the results.

        Make sure all the resources involved have something reasonable in the introtext field. That's the only thing I can think of.


        ------------------------------------------------------------------------------------------
        PLEASE, PLEASE specify the version of MODX you are using.
        MODX info for everyone: http://bobsguides.com/modx.html
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 6146
          • 48 Posts
          It is odd indeed. I have checked all the resources under parent #577 and it all looks good and the results of the GR snippet work - I get what I'm expecting to see. I'm just getting the array also...

          I'll check them again - it can't hurt.

          I even built empty test pages if it would help someone help me figure this out.
            • 3749
            • 24,544 Posts
            Check the default properties of the snippet in case debug is on.


            ------------------------------------------------------------------------------------------
            PLEASE, PLEASE specify the version of MODX you are using.
            MODX info for everyone: http://bobsguides.com/modx.html
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 6146
              • 48 Posts
              Thanks Bob, for your help.

              So changing the chunk fixed the problem:
              [[+introtext:eq=``:then=`<!-- [[+pagetitle]] -->`:else=`[[+introtext]]`]]


              Evidently, one introtext field was empty and caused the Array to show up but the snippet continued to process the rest of the resources without any problem.

              Bug maybe..??
                • 3749
                • 24,544 Posts
                Beats me. wink

                Worth reporting if it can be reliably produced.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting