We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18206
    • 59 Posts
    I think starting to get the hang of MODx now (or so I’m telling myself wink) but some things really strikes me as odd.
    To start with, I was trying to work with the Wayfinder snippet and after an hour or so of failing, I noticed that my error was simple; I was using ’ instead of `.
    I’m sure the more experienced developers are used to this standard, but it’s really confusing to me. I’m using a Swedish keyboard layout and thus the key associated with ` is a "sticky key" -- to get the character I have to hold shift, press it and then push space before any other key.

    The choice of character is odd since the single quote is used in every other scripting language I can think of (when double quotes aren’t used). To me, the grave accent (`) is used on top of characters, like à, ò ù and such, and not as a delimeter.

    I’m further confused by the Variable/Template/Chunk/Snippet delimiters -- there’s just too much going on. [* *] for variables, [[ ]] for snippets, {{ }} for chunks. On a small screen they all look pretty similar and they’re not always easy to tell apart. Adding to that there seems to be snipped defined varieties like [+ +] and so forth.

    Wouldn’t it be easier to read the syntax if it was more self explanatory? [cnk:<chunk name>], [tpl:<template>], [var: <variable>] [sni: <snippet>] and so forth; one standard set of brackets that’s easy to find in code, and an abbreviated word that’s easy to recognize.
      • 3749
      • 24,544 Posts
      Lots of people have these same thoughts when first learning MODx. wink

      The back-ticks are there so that user’s can have single and double quotes in their snippet parameters without escaping them.

      The tags for snippets, chunks, etc. are brief to make for less typing and faster execution. They’re changed slightly in MODx Revolution (not yet in Beta). In Revolution all the tags start and end with [[ and ]] and the individual token idendifying what kind of tag it is appears only at the beginning.

      For example:

      [[snippet]]
      [[$chunk]]
      [[+placeholder]]
      [[*templateVariable]]


      I’m not sure if you’ll like those better but, believe me, it would be a monumental task to change them at this point so it’s definitely not going to happen. smiley

      Welcome to MODx.
        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
        • 29076
        • 615 Posts
        Quote from: BobRay at Nov 06, 2008, 07:33 PM

        Lots of people have these same thoughts when first learning MODx. wink
        I was there my self, but now I really like them. I promise, you’ll get used to them. wink
          I think, thererfor I am! But what I am, and why...?
          • 18206
          • 59 Posts
          Quote from: BobRay at Nov 06, 2008, 07:33 PM

          For example:

          [[snippet]]
          [[$chunk]]
          [[+placeholder]]
          [[*templateVariable]]


          I’m not sure if you’ll like those better but, believe me, it would be a monumental task to change them at this point so it’s definitely not going to happen. smiley

          I think that’s much better! Why the double brackets though?

          Quote from: BobRay at Nov 06, 2008, 07:33 PM

          Welcome to MODx.

          Thank you smiley
            • 27708 MODX Staff
            • 2,502 Posts
            The double brackets are to make sure it doesn’t pick up on the natural use of a single brackets. Revolution uses a custom Smarty Tags.

            BTW if you are finding the tags hard to see on a small monitor I’d suggest getting the "Its All Text" plugin for Firefox to use. It allows you to edit any text area in your favourite text editor. Easier on the eyes and possible syntax highlighting.

            Cheers,

            Jay
              Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
              • 7231
              • 4,205 Posts
              Quote from: ganeshXL at Nov 07, 2008, 07:47 AM

              Also, you can always change the manager-CSS. One of the first things I do whenever installing MODx, is changing Arial to Verdana and increase font-size a notch or two smiley
              And you can always hit CTRL + to increase text (at least in most modern browsers such as Firefox). CTRL 0 = reset, CTRL - decrease text-size.
              There are a few manager templates that have larger font size and more contrast color scheme that I find much easier to read. Look in the repository under manager templates, one of mu favorites is named MODx02k7 (all of the templates by the same author are nice).

              The manager font size could be a site setting wink
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don&#39;t know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 18206
                • 59 Posts
                Thank you, I’m overwhelmed by the great response I’ve had so far smiley
                Extra thanks for that nifty FF-plugin; for anyone else interested, here’s the link to It’s All Text!

                I use it with Notepad++ and it works a treat.