We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8168
    • 1,118 Posts
    Guys, I have been a MODx-er now for nearly 5 years... I love it - best CMS I have used by far!

    One thing that really does drive me mad each time I use it though is the lack of an in-built code validation to hightlight bugs... e.g. I never remember that a TV when included in a GetResources Chunk call should be [[+example]] and not the standard [[*example]] - would it be possible to add in some code reviewing on save of chunks etc in future releases? Might help solve lots of the forum requests for things supposedly not working, when human error miss-entering the syntax is the culprit... ?

    Just an idea for the pot...
      • 6629
      • 60 Posts
      How would you deal with this? smiley
      <a href="[[~[[*id]]]]#[[+alias]]">Jump to section [[+pagetitle]]</a>

        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Over the years there have been a lot of suggestions and thoughts about automating things like this, but the very flexibility that makes MODX so great makes it nearly impossible to do anything like you've suggested. For example, how can you have a utility to show where elements are used? Or even which elements are or are not ever used? Elements such as chunks can be indicated in HTML code by their [[$...]] tags, or loaded in code via getChunk, processChunk and the like, used in TV input option values or default values or specified in external config files...I'm sure I've missed two or three other ways to "use" a chunk.

        And that is the whole point of MODX's "freedom". Nothing in the code in any way restricts how you can use just about anything. That freedom does come with the responsibility to learn to use it wisely, just as any freedom does.
          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
          • 3749
          • 24,544 Posts
          It may help if you remember that * will always get the value of any tag from the resource currently being viewed. In a Tpl chunk used for aggregating content, you always want a placeholder tag with + unless you really want to show a value from the main resource being viewed.

          Susan is right, though, there's literally no way for MODX to know which one you want. [ed. note: BobRay last edited this post 12 years, 7 months ago.]
            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