We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13577
    • 302 Posts
    I’m not really sure if this is the best place for this sort of thing, but it seemed like a nice idea to have a forum for little detail items. Not huge core changes that need loads of debugging, but the little tweaks many of us already do to add a little polish to the recipe. For example- on the manager login screen, I find it very handy to have the username field focused on when the page loads. This can be accomplished by altering the body tag of accesscontrol.inc.php as follows:

    <body onLoad="javascript:document.loginfrm.username.focus();">


    I’m sure it could be done other ways too. That’s the way I did it. Anyone else got any of those little tweaks they’d like to share??

    (And if I missed an existing forum where these things already exist - please point me there!)
      Standard Disclaimer
      I could be totally wrong.
    • That’s a great idea.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 13577
        • 302 Posts
        Another idea-

        How about upon "new snippet" the snippet code box is pre-populated with whatever best practices determines is a good header for the snippet. Something like:

        // ***********************************
        // Snippet: 
        // ***********************************
        // Version: 
        // Date: 
        // Author: 
        //
        // Description
        // 
        
        // CONFIGURATION
        
        // END CONFIGURATION
        


        The developer wouldn’t be committed to it of course, but it would eliminate having to go back and look at another snippet to see how it was done for those who like to be consistent. I know I’d appreciate it.

        The above example is the way I’ve done mine. But I’m NOT suggesting it is the best way. I use it as a familiar example only. Powers that be would be better to determine a recommended standard.

        Just a thought. Of course, mostly I develop snippets outside that text box anyway... but I could copy that bit out of the box into my code editor...
          Standard Disclaimer
          I could be totally wrong.
        • Yes, I’ve been meaning to add a default snippet header to my collection of default templates, like my XHTML default page header that includes the IE conditional block and what-have-you that I like to put in my page headers. I suppose I could put it all in a chunk, and just put a {{xhtml-head}} chunk in my template, but somehow that just isn’t as satisfying as looking at the whole thing all at once!
            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
            • 32241
            • 1,495 Posts
            I believe there will be a plugin/snippets/modules repository right? Which I would suggest having a submission guidelines for all the resources being submited, so that it’s a lot easier to find and to understand.

            Looking forward for all the best practices.
              Wendy Novianto
              [font=Verdana]PT DJAMOER Technology Media
              [font=Verdana]Xituz Media
            • Great suggestions. smiley
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 10826
                • 10 Posts
                Not sure if I’m making an @ss of myself (if this has been addressed elsewhere), but in order to get my pages to validate as XHTML transitional I needed to change lines 1371 and 1372 of "/manager/includes/document.parser.class.inc.php"

                from...
                if ($c=='?') $args = '&'.substr($args,1);
                elseif ($c!='&') $args = '&'.$args;
                


                to...
                if ($c=='?') $args = '&'.substr($args,1);
                elseif ($c!='&') $args = '&'.$args;
                


                ... as well as turning all other resource identifiers from "&" to "&amp;", and "onMouseOver", etc, calls to lowercase site-wide (especially in the Calendar snippet)
                  • 18397
                  • 3,250 Posts
                  AFAIK & characters are what is supposed to be in URLS and I’ve never had a problem with validating using them...
                    • 15914
                    • 145 Posts
                    W3C XHTML Validators don’t like the ampersand character ([tt]&[/tt]) on its own. It requires the entity code instead: [tt]&amp;[/tt]

                    It’s quite picky about that.
                      Kunal Kapoor
                      Technical Director
                      Limesharp Internet Limited - Effective, Functional, Standards Compliant

                      IRC Nick: KingKoopa
                      Skype ID: KingKoopa16
                      • 10826
                      • 10 Posts
                      AFAIK & characters are what is supposed to be in URLS

                      It makes no difference to the function of the URL whether they’re encoded or not - it’s just that the W3C is (as Kunal points out) picky because it parses the page as XML, which...

                      "has constraints on the use of & in parameter literals. In SGML terms, XML says that the ero delimiter is recognized in a parameter literal, and that it must be followed by an entity reference, but the entity reference is not expanded." (http://openjade.sourceforge.net/doc/xml.htm)

                      Small issue, but just thought I’d give a heads-up...