We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46630
    • 40 Posts
    I have the folowing chunks:

    [[getResources? &parents=`13` &tpl=`featured_products_tpl`]]


    and the featured_products_tpl is:

    <div class="large-6 medium-6 small-12 columns panel">[[*longtitle]]</div>


    But instead of showing the titles of the two child resources of resource with id=13, getResources shows two times the title of the homepage (id = 1).


    I don't know what the problem might be.
    Thank you for your help in advance.

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

    • discuss.answer
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      That's because you need to use placeholders in your tpl [[+longtitle]]

      The resource field tag, [[*longtitle]] will pull in the longtitle for the current resource...the one that has the getResources snippet call on it.

      GetResources loops through the child resources, setting the placeholders for each one, and applying them to the tpl chunk as it processes each one in turn.
        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
        • 46630
        • 40 Posts
        Thank you! smiley

        That was a silly mistake.