For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
ajprog wrote:
I agree smarty doesn't care where is it, as long as it isn't in {literal} tags.
Hi ajprog. Not trying to argue with you, just looking for some clarification. I had a need to do something similar (Smarty within a stylesheet) a couple of years ago, and this is the response I ended up getting from Calguy:
Your post in that thread indicated that you wanted to use smarty in a stylesheet.. That isn't supported. This thread is about using smarty tags in inline styles in a template, not in stylesheets.
Last edited by Wishbone on Fri Jan 29, 2010 4:41 am, edited 1 time in total.
I did read your original thread and I have not tested that yet, I have just tested [[assign]] and [[get_template_vars]] which I am not importing any in so currently you are limited to what you assign at the top of the file (unless you try the GCB it may or may not work).
I gave my initial reply of No... because your question lacked enuf info to really give an answer to...
You didn't and still don't say what module this is, or that it was in the modules template that you were trying to pull the info, but I'm going to assume it is one that will give you the category name...
If you can have the module show the category name then every div should be able to get a background image assigned with CSS using the class call...
So No just using {$entry->image} would not work in a page template which is the way most would read your first post...
wishbone wrote:
Your post in that thread indicated that you wanted to use smarty in a stylesheet.. That isn't supported. This thread is about using smarty tags in inline styles in a template, not in stylesheets.
True, but ajprog said "I agree smarty doesn't care where is it, as long as it isn't in {literal} tags." Which would seem to indicate that Smarty within a stylesheet would be fine. Based on my previous experience and the post from calguy, I'm still not sure that's true, unless something has changed since that post, which admittedly was a year and a half ago.
Style sheets are style sheets and no they will most likely never read a smarty tag untll/unless they get changed to run thru the smarty system before going to the front end...
To clarify, the OP has the style within a which means they are using an inline style within a template, with that as the situation, with in a template smarty doesn't care were it is in the template.
As for stylesheets if your {stylesheet} with {smarty_stylesheet}, you can now use smarty in the stylesheet as long as you use [[ ]] instead of { }.
ajprog wrote:
To clarify, the OP has the style within a which means they are using an inline style within a template, with that as the situation, with in a template smarty doesn't care were it is in the template.
Makes sense to me. I guess I was reading more into your statement than you intended.
ajprog wrote:
As for stylesheets if your {stylesheet} with {smarty_stylesheet}, you can now use smarty in the stylesheet as long as you use [[ ]] instead of { }.