We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36632
    • 202 Posts
    &includeContent is a must.
      • 17667
      • 108 Posts
      Just tried it with &includeContent still nothing.

      Changing the ID number in the getResources call to any other resource with sub-pages produces a list of those sub-pages. As far as I can tell this has to do with this resource being an Articles container.
        • 28215
        • 4,149 Posts
        You need:
        &showHidden=`1`


        Since Articles sets hidemenu = 1 in all Articles to prevent Wayfinder madness.
          shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
          • 17667
          • 108 Posts
          Bingo! That was it. Thanks!
            • 36932
            • 39 Posts
            I was struggling with exactly the same problem and thanks to your advice it is working now, so thanks a lot! Maybe it would be worth to have a short paragraph on how to use Articles with getResources in the manual since it's not obvious to anyone, you can work with articles like you do with all other resources?
              • 36632
              • 202 Posts
              I was having issues pulling Latest Articles into my other templates.

              The issue: I don't use pagetitles in my TPLs, and most of the time I don't use introtext, preferring to create "teasers" in my description.

              I imported my existing MODX blog into Articles, which doesn't have description nor longtitle TVs, nor does it have hide from menus.

              That's why my old MODX blog entries show up in Wayfinder, and the new ones don't. I figured I would just edit those 5 pre-Articles entries and manually set "hidemenu" to 1. I thought that would work, but it doesn't.

              Suggestions?
                • 17667
                • 108 Posts
                I am not exactly sure what the issue is UltraSEF but if you are seeing only 5 articles using the getResources call be sure to add:
                &limit=``


                getResources has a default limit of 5.

                * Also *
                Please note Articles was updated since this thread began and you can now use the packaged Articles snippet instead of getResources on pages outside of Articles container:
                [[!Articles? &container=`ID OF CONTAINER`]]
                [[+latest_comments]]
                  • 36632
                  • 202 Posts
                  Hi lukemcd,

                  Thanks for replying. I'm always forgetting to flush my core/cache manually. I edited my 5 pre-Articles blog posts so that they are hidden from menus. They no longer display in my default (non-Articles) templates.

                  It's the equivalent of telling Wayfinder to display all Parents and Children except the Article container...

                  Once MODX Resources are imported into the Articles Container, they retain their existing state and cannot have their attributes changed unless Articles' Property Set (??....nope) or Custom Manager (??.... nope again) is changed to allow that.

                  That's why my 5 pre-Articles posts were displaying in the Wayfinder menu, but none of my new entries were. It had nothing to do with getResources, and everything to do with the fact that Articles Manager interface doesn't display them.

                  Thanks for the snippet example for display options on Resources that are external to Articles.
                    • 52128
                    • 29 Posts
                    Hi

                    The code work well for the article on the homepage, I would love to add the "Featured image" which is template variables with the blog. Is this possible

                    [[getResources? 
                    &parents=`348` 
                    &tpl=`blog_item` 
                    &limit=`3` 
                    &includeContent=`1`
                    &sortby=`publishedon`
                    &sortdir=`DESC`
                    &showHidden=`1`
                    ]]


                    Thanks

                    Magz

                      • 17667
                      • 108 Posts
                      magzzs, you need to add "includeTVs" and "processTVs" to the getResources call to pull in TVs. So your call would change to:

                      [[getResources? 
                          &parents=`348` 
                          &tpl=`blog_item` 
                          &limit=`3` 
                          &includeContent=`1`
                          &sortby=`publishedon`
                          &sortdir=`DESC`
                          &showHidden=`1`
                          &includeTVs=`1`
                          &processTVs=`1`
                      ]]


                      Then in your tpl chunk use something like this to see featured image:

                      <img src="[[+tv.featured_image]]" />