We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42241
    • 25 Posts
    I am pulling posts from Articles to be posted on my homepage, but I would like to limit it to 2 posts pulled. Make sense?

    I am using this (unless someone has a better, cleaner way):

    [[!getResources?
      &tpl=`Homepage.ArticleRowTpl`
      &parents=`11`
      &showHidden=`1`
      &includeContent=`1`
      &includeTVs=`1`
      &processTVs=`1`
      &tvPrefix=``
    ]]
    


    This will pull all of the Articles, if I am not mistaken.

    I am pretty new, as you might have guessed, so cut me some idiot slack. Thanks in advance.

    This question has been answered by BobRay. See the first response.

      Revo 2.3.3
    • discuss.answer
      • 3749
      • 24,544 Posts
      Just add this:

      &limit=`2`


      You may also want to add a &sortby property so you have some control over which two are retrieved. If you use this, you'll get the most recently created ones:
      &sortby=`createdon`


      This will give you the two most recently published ones:

      &sortby=`publishedon`


      This will give you two random ones:

      &sortby=`RAND()`

        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
        • 42241
        • 25 Posts
        Thanks for the speedy reply BobRay! I'll give that a shot
          Revo 2.3.3