We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38441
    • 140 Posts
    (Using Articles 1.4.7 on Revo 2.2.0) In the default Articles templates there's side-menu content showing latest articles, tags, comments etc. And now i understand that this only works inside of the Articles system, and to have that same content appear in other site-wide templates outside of Articles, i need to use getResources. I'm following the documentation from http://rtfm.modx.com/display/ADDON/Articles.Retrieving+Articles+Outside+of+Articles and suspect it's my early understanding of Revo tripping me up here.

    I've installed getResources, so in the first section of the link provided-

    "For example, this getResources call grabs the latest 8 Articles for you in your Container with ID 10:

    [[getResources?
      &parents=`10`
      &tpl=`myTpl`
      &showHidden=`1`
      &limit=`8`
    ]]


    That's all there is to it!"

    But when i place this into a template outside of Articles, nothing appears.. am i missing something?
      • 4172
      • 5,888 Posts
      your articles-container has the ID of 10?
      you have created a chunk with name myTpl?
      your articles are published?

      whats the content of your chunk myTpl?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 38441
        • 140 Posts
        Ok, so the articles container- is the container located in the folder inside Chunks for Articles, being sample.Article RowTpl (10)

        In which case, it has an id of 10, there is a chunk with a name of Tpl and the articles are published..
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          No, the actual Resource that is the Articles container. You need the ID of that resource.
            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
            • 38441
            • 140 Posts
            Thanks Susan, i did try that (the Article Container template is id 17 for example), but nothing being pulled onto the page still.
              • 3749
              • 24,544 Posts
              You may be seeing the cached results. Try

              [[!getResources? . . .



              ------------------------------------------------------------------------------------------
              PLEASE, PLEASE specify the version of MODX you are using.
              MODX info for everyone: http://bobsguides.com/modx.html
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 38441
                • 140 Posts
                Thanks Bob, but still nothing. Just to re-cap if i'm understanding this right, here's the steps i've taken to pull Articles content into other templates / pages that are outside of Articles-

                I've installed getResources

                I've followed the first step on this documentation-

                http://rtfm.modx.com/display/ADDON/Articles.Retrieving+Articles+Outside+of+Articles

                "For example, this getResources call grabs the latest 8 Articles for you in your Container with ID 10:

                [[getResources?
                  &parents=`10`
                  &tpl=`myTpl`
                  &showHidden=`1`
                  &limit=`8`
                ]]


                That's all there is to it!"

                And above, i've replaced the &parents id with that of my article template, and replaced myTpl with sample.ArticleRowTpl

                Then i've placed this call inside my template wrapping it in a div to position it.

                And just to ask as well, if and when this does work or i resolve it, on that link i have provided, it lists what to me looks like two different ways of pulling article content into a page. The first step uses what is described as a getResources call, and the other being a snippet call. What is the difference between the two steps described on that page to pull in content?


                  • 38441
                  • 140 Posts
                  If i try the second step on the link provided, by included this snippet in a template outside of Articles-

                  [[!Articles? &container=`17`]]
                  [[+latest_posts]]


                  I get this error on the page when loading the url-

                  Fatal error: Call to undefined method modDocument_mysql::getPostListingCall() in /home/sovereig/public_html/core/cache/includes/elements/modsnippet/27.include.cache.php on line 45
                    • 38441
                    • 140 Posts
                    Update- Susan, when you said the resource id was the articles container, i used the id of the Article container template, which didn't pull anything in. Now i have used the id of the page in resources (id 61 for example), and it's pulling in the content now! Albeit un-styled for some reason, when that same content is displayed on the articles pages and that's styled correctly.
                      • 38441
                      • 140 Posts
                      Whats the difference between getResources to pull in content from Articles and 'The Articles Snippet' to pull content in? (I've now got getResources pulling in content but tags for the Articles Snippet don't. And by using getResources i need to include Tpl chunks, problem being there is only one listed which pulls in latest articles. I'd also like to pull in 'tags' 'latest comments' and 'Archives' but dont know how to create Tpl chunks for them. Is there even any need to when the Articles Snippet already has tags to do this?)