Can I use page content in a stylesheet
Say for backgroung images the css reads
.teamlist {
background-image:url("uploads/images/test.jpg");
float:left;
width:469px;
height:202px;
padding:0px 0px 0px 0px;
border-right: 2px solid #fff;
}
I would like it to read
.teamlist {
background-image:url("{content block="imagestring"}");
float:left;
width:469px;
height:202px;
padding:0px 0px 0px 0px;
border-right: 2px solid #fff;
}
Or a variable I could have a user change in the page view.
Is there a way?
Thanks
Dan
Using page content in stylesheets
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Using page content in stylesheets
unfortunately no, well not yet anyways.
However, you can put style tags in the header, and use smarty on them.
so in your stylesheet you can do:
.teamlist {
float:left;
width:469px;
height:202px;
padding:0px 0px 0px 0px;
border-right: 2px solid #fff;
}
then in the page template something like this:
{literal}
.teamlist {
{/literal}
background-image: url("{$some_smarty_variable_or_tag}");
{literal}
}
{/literal}
However, you can put style tags in the header, and use smarty on them.
so in your stylesheet you can do:
.teamlist {
float:left;
width:469px;
height:202px;
padding:0px 0px 0px 0px;
border-right: 2px solid #fff;
}
then in the page template something like this:
{literal}
.teamlist {
{/literal}
background-image: url("{$some_smarty_variable_or_tag}");
{literal}
}
{/literal}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Using page content in stylesheets [solved]
Thanks for that read some thing like in that in your post telling us to read the Smarty manual which is now printed out and by my bed!
RTFM becomes RTSM !
Thanks for making that clear, great answer.
RTFM becomes RTSM !
Thanks for making that clear, great answer.