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

    I currently evaluating CMS and I like what I'm seeing in MODX. One thing I don't like tho: tags syntax.

    Here is a library with a different syntax: https://github.com/pyrocms/lex

    Some advantages in my view:

    1) easier to read
    2) don't have special chars (like & and `) that won't be "reinterpreted" by WYSIWYG editors
    3) you don't need to specify your template outside of context (unless you want it):
    {{resources parents="2"}}
    <a href="{{id}}">{{title}}</a>
    {{/resources}}
    It's specially useful when dealing with more complex tags that may need lots of templates/chunks to customize (like wayfinder and breadcrumbs from what I saw).
    4) it's +- the same as handlebars that I'm using in the client-side (javascript) on other sites. That's may be just an advantage for people that uses handlebars, but that's a lot of people. Syntax used by other libraries as well, like emberjs and angularjs.

    I've seen posts like:
    https://forums.modx.com/thread/?thread=36725&page=1
    https://forums.modx.com/forums/thread/24582/template-engine-modx-underlying-framework#dis-post-125655

    But there are almost a decade old.

    So, my question is: how hard is it use something like https://github.com/pyrocms/lex in MODX today?

    And if the template engine is so hard-code into the core, is any plan for implementing something else other than the current syntax? in MODX3 or something.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The wysiwyg mangling problem is very easily solved by using property sets.
        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
        This probably isn't the answer you're looking for, but you can make your default template blank and do any templating/formatting/parsing you want in a plugin before MODX touches the page (at which point the tags would be gone). The Smarty template engine is also built-in, although it's rarely used outside the Manager.
          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