We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1876
    • 835 Posts
    Hi,

    Thank You Mark.

    My personal opinion :
    Attention, do not create a monster snippet which does the coffee, the housework and walks the dog.
    I prefer several snippets, simple and rapid, that only one


    Aour
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      But does it have an option for displaying a single random item?
        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
        • 21301
        • 93 Posts
        Quote from: aour at Jan 07, 2006, 03:43 AM

        My personal opinion :
        Attention, do not create a monster snippet which does the coffee, the housework and walks the dog.
        I prefer several snippets, simple and rapid, that only one

        Great work Mark!

        I do fully agree with Aour above. As you know I’ve worked on something similar. I wondered why you didn’t use this function or something similar. Personally I find Olaf’s ChildDocumentMapper a very simple, usefull and easily extendable basis. What’s your reason for not building on top of that?
          • 25663 MODX Staff
          • 12,272 Posts
          The NewsListing work was started before the others existed if my internal clock memory is right... The benefit of having it all in one spot is that it gives a new user the ability to only deal with a single snippet vs. configuring multiple bits of code.

          I too tend to prefer small, purpose-built chunks, but NewsListing is definitely an exception I’ll gladly make as it allows me to emulate virtually any style blog. cool Besides, we can always clean it up into a nice little modular package later... let’s nail the functionality down first!
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 18397
            • 3,250 Posts
            Ok, wow alot happened in the few hours I was asleep!

            @aour: The snippet does alot of things for two simple reasons. Every feature of the snippet is related to listing news and each of the functions does the same basic set of actions with minor differences. Therefore splitting this up into multiple snippets would involve repeating the same basic code with only minor changes making it a nightmare to maintain. Just think back a few months ago. I had to do everything I did in NewsListing to NewsFeed, NewsArchiver, etc. You get the idea...


            @Theo: I couldn’t use getDocumentChildrenTV because it couldn’t handle multiple levels and Jason wasn’t happy with customSort. Ryan is correct in that NewsListing was around WAAAY before ChildDocumentMapper, so it would have been impossible to build off of it. BUT, I have pulled alot of code and code ideas from your version of ChildDocumentMapper for use in NewsListing.

            EDIT: FYI ChildDocumentMapper was origionally 42 lines and after Theo added additional features it became 169 lines. Thats over 3 times its initial size. In that same manner NewsListing has grown by adding useful and related features to create a bigger better snippet!

            @Ryan: "we can always clean it up into a nice little modular package later... let’s nail the functionality down first!" Thats coming soon as I’m slowly learning how to impliment advanced functions and classes from Jason.
              • 33453
              • 141 Posts
              The file snippet.newslisting.6.1.txt in the current download contains the characters "<?" on the first line. This should be removed.
                • 18397
                • 3,250 Posts
                Ooooops! Sorry, please remove that <?
                  • 21301
                  • 93 Posts
                  Quote from: Mark at Jan 07, 2006, 11:29 AM

                  @Ryan: "we can always clean it up into a nice little modular package later... let’s nail the functionality down first!" Thats coming soon as I’m slowly learning how to impliment advanced functions and classes from Jason.
                  That’s great news! I love all the functionality of this snippet. When functionality grows architecture and maintenance become more impotant. I’m happy to see this is going the right way!

                  Are the advanced functions and classes from Jason happening in another thread?
                    • 25663 MODX Staff
                    • 12,272 Posts
                    No threads, theo. But look for some cool stuff soon, I suspect. Mark is Mr. Version Rocket. wink
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 21301
                      • 93 Posts
                      Can’t wait! And thanks for the info!