That was an interesting digression regarding templates, but to get back to my original topic,
Smarty config files, let me give a simple example to clarify:
On a CMSMS 1.11.12 site, my first CMSMS stylesheet contained the following:
Code: Select all
[[$cfgpath=cms_join_path(realpath(dirname($smarty.server.DOCUMENT_ROOT)), '.mysite.conf')]]
[[if ! #css_rev#]][[config_load section='css' file=$cfgpath scope='parent']][[/if]]
/* [[#css_rev#]] */
This would load the 'css' section of my Smarty config file and make those variables available for subsequent stylesheet processing by Smarty. This worked for both frontend pages and for backend pages (e.g. editcontent.php w/TinyMCE).
After upgrading to CMSMS 1.12, I moved .mysite.conf to $config['root_path']/tmp/templates/ and removed the file path from the [[config_load]] statement in my first stylesheet. Smarty, however, failed to find .mysite.conf in $config['admin_dir']/configs/, which then caused modules/TinyMCE/stylesheet.php to fail to properly load stylesheet information into the, now, not-so-WYSIWYG editors.
I did come up with the following workaround steps to get TinyMCE working again:
1) Create the missing directory $config['admin_dir']/configs/
2) Put a link/symlink to tmp/templates/.mysite.conf into the admin/configs directory
While this works, it appears overly complicated, error prone, and less secure. Perhaps the advantages of the recent "config dir" changes are worth it. I don't know. Without knowing the original design goals, it's hard for me to even suggest alternative implementations.
Generally, I try to follow "Einstein's Razor": Make things as simple as possible, but not simpler. So, I'm asking for dev team to reevaluate their implementation choices regarding Smarty config directories and see if there might not be simpler solutions available.
Hope this helps,
--Fred P.
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln