-
- 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.