I just added a new plugin for stylesheet retrieval.
http://dev.cmsmadesimple.org/projects/smartstylesheet
It is a rework of the {stylesheet} which exports a static file for the page to use, it automatically updates when the stylesheet is updated.
I also added smarty processing with the delimiters of [[ and ]], so you can have [[assign var=color1 value='#c3c3ce']] at the top of the file and then use later with [[$color1]]
Just a reminder, when static stylesheets are created the background image location usually needs to be changed. An easy way I found to do it is have [[assign var=dir value='/mydir/']] (watch the '/') at the beginning of the file and then do a search/replace with 'url('/'url([[dir]]'
Stylesheet caching w/ smarty variables
Re: Stylesheet caching w/ smarty variables
Hi, I'm very insterested of using variables in stylesheets. Could you explain how to install and use this feature?
I have tried to do it as following:
Uploaded file: function.smarty_stylesheet.php to /functions/ directory.
Replaced {stylesheet}-tag to {smarty_stylesheet} in page template.
After doing this I'm getting error: Fatal error: Call to undefined function cms_smarty() in /home/jannehav/public_html/plugins/function.smarty_stylesheet.php on line 71
I have tried to do it as following:
Uploaded file: function.smarty_stylesheet.php to /functions/ directory.
Replaced {stylesheet}-tag to {smarty_stylesheet} in page template.
After doing this I'm getting error: Fatal error: Call to undefined function cms_smarty() in /home/jannehav/public_html/plugins/function.smarty_stylesheet.php on line 71
Re: Stylesheet caching w/ smarty variables
Sorry about that I accidentally uploaded my 2.0 version. I have now update it with the 1.6.x version.
http://dev.cmsmadesimple.org/projects/smartstylesheet
http://dev.cmsmadesimple.org/projects/smartstylesheet
Re: Stylesheet caching w/ smarty variables
Thank you for your great release.
I also noticed that function name should be changed from smarty_cms_function_stylesheet to smarty_cms_function_smarty_stylesheet to avoid redeclare error.
I also noticed that function name should be changed from smarty_cms_function_stylesheet to smarty_cms_function_smarty_stylesheet to avoid redeclare error.
Re: Stylesheet caching w/ smarty variables
Thanks, fixed it.
Re: Stylesheet caching w/ smarty variables
search/replace with 'url('/'url([[dir]]' should be: search/replace with 'url('/'url([[$dir]]'ajprog wrote:
Just a reminder, when static stylesheets are created the background image location usually needs to be changed. An easy way I found to do it is have [[assign var=dir value='/mydir/']] (watch the '/') at the beginning of the file and then do a search/replace with 'url('/'url([[dir]]'
Re: Stylesheet caching w/ smarty variables
The creation and edit date of the css file is getting the value 1-1-1970 in the tmp directory. Is their a way to let it generate the current date and time?
Re: Stylesheet caching w/ smarty variables
This type of style sheet is now integrated into CMS Made Simple, it is {cms_stylesheet} and is included in all new installs/upgrades...