We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32678
    • 290 Posts
    I'm using pdoResources to build a menu, and it does not parse the ID template tag when the template is called with @INLINE or @CODE.

    Here's what doesn't work:

    [[!pdoResources?
      &parents=`19`
      &depth=`2`
      &showHidden=`1`
      &sortby=`{"menuindex":"ASC"}`
      &includeTVList=`menutitle,menuDescription,id,longtitle`
      &tvPrefix=``
      &tpl=`@CODE <li><a href="[[~[[+id]]]]" title="[[+longtitle]]">[[+menutitle]] | [[+menuDescription]]</a></li>` // If I replace this with the chunk name, all is well
    ]]


    Any idea why pdoResources doesn't like this? A bug, perhaps?

    This question has been answered by sottwell. See the first response.

    • discuss.answer
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Try it with a chunk tpl instead of inline. MODX can get unhappy with tags nested too deeply.@CODE is a little iffy anyway. I've learned to only use it for extremely simple tpls.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 32678
        • 290 Posts
        Quote from: sottwell at May 26, 2015, 11:41 PM
        Try it with a chunk tpl instead of inline. MODX can get unhappy with tags nested too deeply.@CODE is a little iffy anyway. I've learned to only use it for extremely simple tpls.

        I didn't know about the issues with INLINE / CODE. Thought this was pretty simply, but guess not. Thanks!