How do I dynamically assign values to .css file based on values in Document Type.
So for example, if my document type contains Width and Height fields, and I set them as 10px and 20px accordingly, then I would like my .css looked as:
.image {
width: 10px;
height: 20px;
}
Any thoughts?
PS.
There's strict requirement not to use inline styling and HTML Style tag.
Placeholders in .css file.
Hi guys.
How do I dynamically assign values to .css file based on values in Document Type.
So for example, if my document type contains Width and Height fields, and I set them as 10px and 20px accordingly, then I would like my .css looked as:
.image {
width: 10px;
height: 20px;
}
Any thoughts?
PS.
There's strict requirement not to use inline styling and HTML Style tag.
Various ways of doing this - One is use a self referencing altTemplate.
In yoursection, you will need to add something like this
Very nice, Paul.
Your solution works perfectly!
Hi Paul.
Is there a way to disable escaping for inline macro?
For example, when I have this CSS rule in the template:
<umbraco:Macro runat="server" language="cshtml">
@{
Context.Response.ContentType = "text/css";
}
.body
{
font-family: "myriad-pro-condenced", sans-serif;
}
</umbraco:Macro>
It will be automatically converted to the escaped symbols:
.body {
font-family: "myriad-pro-condenced", sans-serif;
}
Think you may need to use...
@Html.Raw(Model.myFont)
Perfect!
It works, thanks.
is working on a reply...