We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47742
    • 13 Posts
    I have a document (id=9) that contains 2 documents (id=28 and 29), each with multiple static resources. I want to render the page for the top level document (id=9) and call getResources to pull the [[*pagetitle]] for each of the children documents, with their children static resources listed. With my logic listed below, I get the 2 documents with all of the static resources listed under each one. It seems to pull the [[+id]] from the original document (id=9) instead of the 2 children documents (id=28 and 29). Any suggestions?

    This is what I have for the page chunk:

    [[!getResources? &tpl=`financeTpl` &showHidden=`1` &sortdir=`ASC` &sortby=`menuindex` &depth=`0`]]

    In financeTpl:

    <p class="sectionHead">[[+pagetitle]]</p>
    [[!getResources? &tpl=`docsTpl` &showHidden=`1` &includeContent=`1` &sortdir=`ASC` &sortby=`menuindex` &parents=`[[+id]]`]]

    In docsTpl:
    <p><a href="[[+content]]">[[+pagetitle]]</a></p>
      • 30912
      • 463 Posts
      Looking at it it should be correct, what happens if you specify the parent in the initial call and uncache the call?

      Page

      [[getResources? &tpl=`financeTpl` &showHidden=`1` &sortdir=`ASC` &sortby=`menuindex` &depth=`0` &parents=`9`]]


      Finance

      <p class="sectionHead">[[+pagetitle]]</p>
      [[getResources? &tpl=`docsTpl` &showHidden=`1` &includeContent=`1` &sortdir=`ASC` &sortby=`menuindex` &parents=`[[+id]]`]]


      Out of habit i always specify the parent in the initial call, also what happens if you change the parents in the nested call to one of the id's you are trying to list? i.e 28?

        • 47742
        • 13 Posts
        Nothing changes if I uncache the call and specify the parent in the inital call.

        If I hard-code the parent in the financeTpl, it works... but I want to allow the user to add other sections if needed.

        I noticed my code was using &parents=`[[*id]]`, then it pulls everything from the top parent (id=9) and below. I corrected it to `[[+id]]` and it worked correctly!?! I spent hours looking at the code for typos and didn't see it until today.

        Thank you for your suggestions!