We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4675
    • 38 Posts
    cartierbailey Reply #1, 13 years ago
    I intalled getResources, and doublecheck to make sure it was installed.

    Then I created a container document with the following tag:

    [[!getResources:default=`No results found`? &parents=`25` &tpl=`resources`]]

    and created content files under resource #25.

    Also created a template chunk called resources

    <h4>[[+pagetitle]]</h4>
    [[+content]]

    Need help...

    I am changing from evolution to revolution, and found Ditto! to be much easier to use, but GetResources seem to be a different ballgame.

    This question has been answered by multiple community members. See the first response.

    [ed. note: cartierbailey last edited this post 13 years ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Are you sure that the child resources you created are published?
        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
        • 22840
        • 1,572 Posts
        You need to include the following in your call:

        &includeContent=`1`


        http://rtfm.modx.com/extras/revo/getresources

        [[!getResources:default=`No results found` &parents=`25` &tpl=`resources` &includeContent=`1`]]


          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Shouldn't the pagetitle header be displayed, even if the content isn't?
            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
            • 22840
            • 1,572 Posts
            Quote from: sottwell at Sep 02, 2013, 01:26 AM
            Shouldn't the pagetitle header be displayed, even if the content isn't?

            Yes, but there was also a random ? in the call which I don't think should be there so I've also removed that as well
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              [[getResources:default=`No results found`? 
                  &parents=`3` 
                  &tpl=`resources` 
                  &includeContent=`1`
              ]]

              displays all resources under #3. Without the ? it just displays the default debug arrays for the children of the current resource - in other words none of the properties are recognized. Without the &includeContent property it still displays the pagetitle headings.
                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
                • 22840
                • 1,572 Posts
                Hmmm never seen a ? outside of the back ticks, my bad wink
                • discuss.answer
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                    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
                    • 4675
                    • 38 Posts
                    cartierbailey Reply #9, 13 years ago
                    Thank you. Seems I'm getting somewhere, but I think my problem now is the formatting of the data output.

                    Right now, my call:

                    [[!getResources? &tpl=`pressReleaseTmp` &includeContent=`1`]]

                    My pressReleaseTmp chunk is as follows:
                    <h2><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h2>
                    <p>[[+introtext]] <a href="[[+url]]"> <i>read more...</i></a></p>


                    results in a listing of arrays, but it's not being formatted the way I'd like it to be formatted.

                    You can view this on this page:

                    http://centralcaribooarts.com/CCACS2/index.php?id=30

                    My old page that lines it up the way I wanted it is here (on evo & Ditto!):

                    http://www.centralcaribooarts.com/news/press/
                    • discuss.answer
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      That's simply a matter of adjusting your tpl and the CSS for it. Really, getResources isn't all that much different than Ditto.

                      You shouldn't need to be calling getResources uncached.
                        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