We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19975
    • 429 Posts
    Hi, not sure if this has already been discussed or even done. But has MODx considered setting a standard for snippet parameters. It seems logical that some snippets require repeated functions and if the parameters could be standardised it would be very easy to learn new snippets.

    As a developer, once I’ve an understanding of the standardised snippet parameters I would only need to learn some new custom snippet specific parameters and roll with a new snippet.

    A list could be contributed by the community of developers undertaking snippet development and would be a reference to anyone undertaking snippet creation in the future.

    Snippets meeting the MODx parameters standard could be featured in the repository with a small logo so anyone wishing to use it would know. Likewise if the snippet developer prefers to do things their own way the snippet would still work as current.

    Just an idea wink
      Martin Sanders - Design & Web Development
      • 25663 MODX Staff
      • 12,272 Posts
      That’s an interesting idea. There are some things which I could see as benefitting from some suggestions/best practices like defining what Site Tree node upon which to act (e.g., &parents=`1,4,9`), template naming (e.g., &outerTpl=`foo.outer` &innerTpl=`foo.inner`), etc. Thoughts?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 22303 MODX Staff
        • 10,725 Posts
        I’ve thought a lot about this, and IMO, standard properties (as they are referred to in Revo) are important, but I think this is something that should be dealt with by individual or teams of developers. IOW, they might develop a library of loosely coupled components that depend on specific properties. But I’m not convinced this needs to be something imposed on all developers by the framework (or even the community).
          • 25663 MODX Staff
          • 12,272 Posts
          Not imposing, just making best practices suggestions. Some thoughtful advice based on years of experience might help eliminate pain and refactoring down the road. Especially as new developers come on board who are not as familiar with things in MODx-land. There will always and maybe even more often than not be exceptions to the suggestions.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 24935
            • 160 Posts
            Something like ’coding best practices’ is always good.
              • 11055 ☆ A M B ☆
              • 3,112 Posts
              Quote from: OpenGeek at Aug 31, 2009, 09:32 AM

              I’ve thought a lot about this, and IMO, standard properties (as they are referred to in Revo) are important, but I think this is something that should be dealt with by individual or teams of developers. IOW, they might develop a library of loosely coupled components that depend on specific properties. But I’m not convinced this needs to be something imposed on all developers by the framework (or even the community).
              Master Geek,
              I’m not underestimating your capability to hold all the codes in your fingers.
              But there are many people around here, converter, plain coder, or just a trendy designer, who might have a simple yet brilliant idea that come accross and eagerly want to share it to this community.
              The ModX’s undisclosed (eg:...)"Coding Style Guidelines" perhaps will make the development faster, but undercontrol.
                Rico
                Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                MODx is great, but knowing how to use it well makes it perfect!

                www.virtudraft.com

                Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                Maintainter/contributor of Babel

                Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
                • 28215
                • 4,149 Posts
                Quote from: goldsky at Aug 31, 2009, 10:24 AM

                The ModX’s undisclosed (eg:...)http://www.concrete5.org/help/building_with_concrete5/developers/coding-style-guidelines/"" target="_blank" rel="nofollow">"Coding Style Guidelines" perhaps will make the development faster, but undercontrol.

                http://svn.modxcms.com/docs/display/revolution/MODx+PHP+Coding+Standards

                We definitely will be adding more to this in the future, as well.
                  shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                  • 11055 ☆ A M B ☆
                  • 3,112 Posts
                  thx, shaun.
                  Do you have evo’s link?
                  I need evo, since the connection limit in my country here can not hold the Revo’s big stream. smiley

                  edit:
                  dial-up still rules in here. yeah, i know, it sux. grin
                    Rico
                    Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                    MODx is great, but knowing how to use it well makes it perfect!

                    www.virtudraft.com

                    Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                    Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                    Maintainter/contributor of Babel

                    Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
                    • 18961 ☆ A M B ☆
                    • 237 Posts
                    I’m a designer and very new to ModX. Love everything I see so far. I personally would love an easy to follow "best practices" or "common usages" file. I’ve found a lot of stuff. But, it’s a little all over the place.
                      Michael Smull
                      http://www.bigpixelstudio.com
                      twitter: @mdsdesign
                      • 9207 ☆ A M B ☆
                      • 2,475 Posts
                      I’ll second Ryan and Jason’s (and others’) call to follow best practices when constructing Snippets and implementing their interface (i.e. their parameters), but I think it’s impossible to have any standardization beyond this. There are an infinite # of Snippets possible performing an infinite # of tasks. If anything, make sure that variable names are included in the "best practices" and handle some of the common MODx parlance (e.g. Tpl = Template = a Chunk used for formatting).