We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    NewsListing with a toggle for showing the archive list, and a toggle for displaying a single random item. Also fixed the function so the snippet can be called more than once on the same page. Based on the latest available version of basic NewsListing.

    If &showarch is set to false, the archive list will not be generated.

    If &singleRandom is set to true, a single random item will be returned, and the archive list will automatically not be generated. Otherwise, the content returned will be as usual, and can pretty much be controlled with a template chunk.

      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
      • 33337
      • 3,975 Posts
      Hi Susan,

      Thanks for sharing nice snippet ! Bloggers will love this snippet.

      Best regards,

      zi
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        I’m still working out a bug or two...trying to get too clever.

        Fixed the showarch bug. Latest fixed version attached to first post.
          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
          • 6726
          • 7,075 Posts
          This is COOL thanks for sharing laugh

          Might just use MODx for my blog too !
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l'outil id
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            As soon as I get around to it, I’m going to add two more options, "sortby" and "sortdir", and use those variables in the main query so you can sort by createdate, by menuindex, by title, or whatever else you want. Probably will leave the default at createdate and DESC, since that’s what most blogs and news pages use.
              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
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Added &sortby and &sortdir to the argument options, as well as adding [+longtitle+] to the template.

              [!NewsListingPlus? &startID=`53` &tpl=`ShopSummary` &summarize=`20` &truncSplit=`false` &truncText=`View Item` &sortby=`menuindex` &sortdir=`asc`!]

              Latest version attached to first post in this thread.
                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
                • 6726
                • 7,075 Posts
                Very nice, thanks !!!
                  .: COO - Commerce Guys - Community Driven Innovation :.


                  MODx est l'outil id
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Sorry about that, I attached the wrong file! Correct file is attached to the first post in the thread.
                    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
                    • 18397
                    • 3,250 Posts
                    Quote from: sottwell at Nov 26, 2005, 01:15 AM

                    Added &sortby and &sortdir to the argument options, as well as adding [+longtitle+] to the template.

                    [!NewsListingPlus? &startID=`53` &tpl=`ShopSummary` &summarize=`20` &truncSplit=`false` &truncText=`View Item` &sortby=`menuindex` &sortdir=`asc`!]

                    Latest version attached to first post in this thread.

                    In your version, the user CAN NOT choose the publish date because it will be 0 unless it is sent.
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Sorry, I don’t understand what you mean by "unless it is sent".
                        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