We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24719
    • 194 Posts
    i’ve been playing around with alpha-3, and smarty looks great.

    i’ve created my own context (’site1’), and i’ve set up controllers, connectors, processors and templates for it (because i want it to be a rich ajax app).

    one of the templates i’m using is called ’header.tpl’, and the manager also has a template called that.

    1) now, if i clear the cache and log in to the manager, it works fine.
    2) then if i go to the url associated with my ’site1’ context, that works fine too.
    3) however, when i refresh the manager, i now see the header.tpl from site1.

    i looked in the modx/core/cache directory. while there are subdirectories for each context, there is only one directory for the smarty, and both header.tpl cache files are called the same thing (even though the contents are different, which makes me think smarty isn’t md5-ing the contents of each template to generate a file name like i’d expect).

    so, i was thinking it would be a good idea if the smarty respected contexts too, maybe saving files in /core/cache/smarty/mgr, /core/cache/smarty/site1, etc. or putting a smarty directory within each /core/cache/context directory.

    i’ve checked the list of system settings, and can’t see anything to do with a smarty cache path in there. also, since the cache manager does a good job, i don’t particularly want to have to explicitly override the cache path myself.

    is this something that needs work in the core to make smarty respect contexts, or is there something i’ve missed that i should do myself?

    cheers
    • There has been absolutely no work on the use of Smarty in Contexts other than the manager. Connectors, controllers, processors and templates, ack; I’m still not really happy about the complexity of the manager in that regard; either way you are pioneering on this one and I’ll let splittingred discuss any ideas on how to make that work in multiple Contexts.

      But I dare say I think that defeats the purpose of using MODx personally; why not just use xPDO and Smarty and keep it much simpler? Smarty was intended only to make the manager easier to maintain.
      • Indeed, MODx (in the web context) is in itself a templating system. Smarty is just redundant.
          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
          • 28215
          • 4,149 Posts
          Quote from: redman at Aug 05, 2008, 07:37 AM

          so, i was thinking it would be a good idea if the smarty respected contexts too, maybe saving files in /core/cache/smarty/mgr, /core/cache/smarty/site1, etc. or putting a smarty directory within each /core/cache/context directory.

          Yes, it should.


          is this something that needs work in the core to make smarty respect contexts, or is there something i’ve missed that i should do myself?

          Yes. I’d say this is a bug that needs fixin’. Could you open up a JIRA ticket?

          Thanks redman.
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 24719
            • 194 Posts
            @splittingred: not sure if you saw the note i posted at the end of the ticket, but the issue isn’t quite fixed.

            see:

            http://svn.modxcms.com/jira/browse/MODX-252

            cheers