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

    I’m having issues displaying child resources using the getResources Package.

    I have a parent Document Resource (set as a Container) named Projects. It uses my default Base Template.

    I then have multiple child Document Resources within the Projects container. These are all the individual "Projects" the company has completed. These child documents use a different template titled, "projects_template".

    What I’m trying to do is output each Project on the Parent "Projects" document resource when a user views the page. When I attempt to do this I only seem to be able to return the array and shows it’s key/value pairs.

    Here’s my getResources call:

    <p>[[!getResources? &parents=`5` &includeContent=`1` &includeTVs='1' &processTVs=`1` &tvPrefix=`` &showHidden='1' &tpl='projectsChunk']]</p>
    


    The ID of the Projects container is 5 (if you care to see the page http://cougar.showtimedesigner.com/index.php?id=5). Each child document is hidden so I chose to show them. I have created a Chunk title: projectsCunk.

    My projectsChunk Chunk simply displays the following:

    <ul>
    <li>[[+project_image]]</li>
    <li>[[+project_information]]</li>
    <li>[[+project_cost]]</li>
    <li>[[+project_company_name]]</li>
    </ul>


    These are the TVs from the "projects_template" that each child project document uses to describe a project. For now I’ve chose to simply display them in a simple list. I’m just doing this temporarily while trying to get this to work.

    I am sure I’m missing something. I have a feeling it has to do with the Parent Container using a different template than each child document, but I’m not certain.

    Any help with this would be GREATLY appreciated.

    Thanks,

    Shane
      • 8609
      • 607 Posts
      First thing I would recommend is check your getResources call and make sure you’re using backticks `` and not apostrophes ’’. getResources returning an array means it’s working but it’s not seeing your tpl chunk, which is probably because it’s got apostrophes and not backticks. Also, it’s a good idea to toggle the RTE off when you’re typing snippets in.

      <p>[[!getResources? &parents=`5` &includeContent=`1` &includeTVs=`1` &processTVs=`1` &tvPrefix=`` &showHidden=`1` &tpl=`projectsChunk`]]</p>

        • 27122
        • 5 Posts
        einsteinsboi,

        You just made my day!!! Thank you so much for the prompt response. I only wish I would have posted my question a few days ago when I began struggling with this. I didn’t want to be "annoying forum guy".

        I wasn’t using backticks, as you recommended.

        Thanks again for your help. I really appreciate it.

        Shane
          • 8609
          • 607 Posts
          Glad it worked, we’ve all tripped on these backticks at some point or other. Please edit your original post title and add [SOLVED] smiley

          Quote from: showtimeshane at Apr 08, 2011, 12:13 PM

          einsteinsboi,

          You just made my day!!! Thank you so much for the prompt response. I only wish I would have posted my question a few days ago when I began struggling with this. I didn’t want to be "annoying forum guy".

          I wasn’t using backticks, as you recommended.

          Thanks again for your help. I really appreciate it.

          Shane