We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    Quote from: sottwell at Aug 01, 2008, 12:27 AM

    So the snippet has to be Smarty-aware, then.

    Yes, and I don’t know enough about Smarty to know what the scope of the variables is or what you’d have to do (if anything) to make sure the snippet’s Smarty template had access to those variables.

    It raises the question of ditching the MODx parser and doing it all with Smarty. I’m sure it’s been considered, but I don’t know what the ramifications would be. It would certainly be a major change.
      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
      • 25663 MODX Staff
      • 12,272 Posts
      Smarty can’t interpret MODx variables, @BINDINGs or Document objects. It’s more of a presentation layer whereas the MODx parser does other interesting things as well.

      xPDO + Smarty does provide for an interesting alternative in some situations though.
        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
        Quote from: BobRay at Jul 31, 2008, 02:32 PM

        The way I thought of it, they would just become Smarty placeholders. Smarty calls them "variables" (which they are) and they are more powerful than placeholders in that they can include "modifiers" They’re set off by curly braces and the "modifier" is the part after the "|".

        User Information:<p>
        Name: {$name|capitalize}<br>
        Addr: {$address|escape}<br>
        Date: {$smarty.now|date_format:"%Y-%m-%d"}<br>



        You can see more here: http://www.smarty.net/crashcourse.php
        You mean they used to be more powerful than MODx placeholders... tongue

        As of Revolution, all tags have "modifiers" in MODx and you can configure custom filtering functions to extend the built-in behavior of these "modifiers". In MODx this is now known as InputFilters and OutputFilters, and I think once some innovative site developers start working with these facilities, you’ll start to see some really amazing solutions that can apply to placeholders, or any tag output returned by a snippet, chunk, TV, etc.

        And we’re not going to replace the MODx parser with Smarty, at least not while I’m here. It’s simply used instead of the MODx parser in some contexts (e.g. mgr), and giving developers the possibility of incorporating existing sites developed in Smarty into a MODx managed site (which could easily be done using a context and the Resource import facilities; just import all your tpl and controller files as static resources, so they can be managed in the tree).
          • 3749
          • 24,544 Posts
          Quote from: OpenGeek at Aug 01, 2008, 09:07 AM

          You mean they used to be more powerful than MODx placeholders... tongue

          As of Revolution, all tags have "modifiers" in MODx and you can configure custom filtering functions to extend the built-in behavior of these "modifiers". In MODx this is now known as InputFilters and OutputFilters, and I think once some innovative site developers start working with these facilities, you’ll start to see some really amazing solutions that can apply to placeholders, or any tag output returned by a snippet, chunk, TV, etc.

          Tres cool. Like I wasn’t impressed enough with Revolution. grin
            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