2864 Posts in 732 Topics by 700 members
Template Questions
SilverStripe Forums » Template Questions » Appending .px to template variable
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba
|
Page:
1
|
Go to End | |
| Author | Topic: | 687 Views |
-
Appending .px to template variable

20 February 2010 at 1:38pm
Hi,
How would I append to .px to a template variable.For example,
This in the template
<div id="FlashContainer" style="margin:$TopMargin.px 0 0 $LeftMargin.px">returns
<div id="FlashContainer" style="margin: 0 0 ">How do I add .px to the end of $TopMargin or $LeftMargin so that I get something like:
<div id="FlashContainer" style="margin:300.px 0 0 400.px">Thanks in advance,
Sam -
Re: Appending .px to template variable

7 March 2010 at 5:12am Last edited: 7 March 2010 5:13am
<div id="FlashContainer" style="margin:{$TopMargin}px 0 0 {$LeftMargin}px">
Don´t let anyone change CSS via the backend, this will blow up in your face sooner or later.
-
Re: Appending .px to template variable

7 March 2010 at 7:02am
hi
i guess the issue is solved with {$x}px.
but baba-papa ok there are pros & contras for controlling styles trough the cms - what is best practice if you do? would you make inline styles in the template? how do you actually use $vars in the css files?
luk
-
Re: Appending .px to template variable

7 March 2010 at 8:19pm
Usualy customers are the ones that work with the backend. As they do not know much about css or browser bugs they should not interact with css.
| 687 Views | ||
|
Page:
1
|
Go to Top |



