We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43280
    • 15 Posts
    Hello, first post here and i want to say modx is just...absolutely amazing!! im "fairly" proficient in html/css, still have a ways to go with php and other languages, but learning modx has made coding very fun again and im almost ready to really publish my site!

    However i had a question related to articles: is there a way to make a "specific" setting for [[+articles]] using the same articles container for different pages? Allow me to explain further:

    I have a site with a "specific" blog page which is essentially my articles container. however on the "home" page i have a small section for recent posts. Now i know about the [[+latest_posts]] "snippet" (not sure what the right word is im still learning forgive me!) but on my main page it's not what im looking for, I'm actually looking to display the last two blog articles in the way that [[+articles]] does.

    So to sum up, is there a way to do something like this on my main home page (outside of articles):

    <div class="blogPostContent">              
    		[[!Articles? &container=`15`]]
    		[[+articles]]
                  [[+paging]]
         </div>


    and then have this with a setting of "maximum 2 posts per page", while having a different setting like say "10 posts per page" in my actual articles container? I hope this makes sense. Any help is appreciated, if this is covered forgive me i tried to search for this but came up with nothing. Thanks for any insight!





    edit: well silly me didn't read the articles documentation all the way until the "get articles stuff outside of articles" section <__< the answer if anyone stumbles with this is to use getResources versus trying to set two different setting configurations for your articles (where do i come up with these ideas lol)


    so i basically did this:

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


    the tpl i had to edit a bit to get it to fall inline with my other styles, and "&limit" is where you set the number of blog posts you want to display, "&parent" is where you set the resource id. sigh, how silly of me, hope no one went digging around to help solve this non issue. Guess i still have a bit more to learn but with each step it gets clearer smiley

    section to reference in articles documentation: http://rtfm.modx.com/display/ADDON/Articles.Retrieving+Articles+Outside+of+Articles [ed. note: wonderfulweb last edited this post 13 years, 6 months ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The trick to understanding this is that "Articles" are still just resources, even if they are custom resource types. You can still use any of the resource listing snippets to display them and otherwise manipulate them for the front-end that you would for any other resource. The "Articles" package itself comes with a bunch of these snippets built-in and using placeholders ([[+whatever]]) for a specific type of output, but you are by no means limited to using them.
        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
        • 43287
        • 2 Posts
        How can I pull the content of the article? I can pull +introtext but +content doesn't do anything.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          See the documentation on getResources. By default, it doesn't get the content or TVs in order to keep its basic functionality smaller and quicker.
          http://rtfm.modx.com/display/ADDON/getResources#getResources-OtherProperties
            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
            • 43287
            • 2 Posts
            Thank you sir, I read that more times than I'm willing to admit but didn't obviously actually see the includecontent option
              • 43280
              • 15 Posts
              Quote from: sottwell at Apr 04, 2013, 07:31 PM
              The trick to understanding this is that "Articles" are still just resources, even if they are custom resource types. You can still use any of the resource listing snippets to display them and otherwise manipulate them for the front-end that you would for any other resource. The "Articles" package itself comes with a bunch of these snippets built-in and using placeholders ([[+whatever]]) for a specific type of output, but you are by no means limited to using them.

              yes, I am just now fully grasping the concept of "resources" and "snippets". It seemed a bit cryptic to someone of my skill level at first, but now that i understand it more i recognize how powerful it is.

              Thanks for your reply smiley
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                MODx comes from MODular, eXtensible. So think of all these resources and elements as Lego blocks. Templates are base plates, and all the rest are different colored blocks that can be plugged in to the template and each other to build up the site you want.
                  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