Umbraco 7 | If checkbox "checked" add class to body
Hi Guys,
I'm new to razor but not Umbraco and I'm wanting to know how to add a class to the body element if the user "checks" a checkbox within the generic properties tab.
I understand this is simple but unsure on the code to append to the body tag.
Umbraco 7 | If checkbox "checked" add class to body
Hi Guys,
I'm new to razor but not Umbraco and I'm wanting to know how to add a class to the body element if the user "checks" a checkbox within the generic properties tab.
I understand this is simple but unsure on the code to append to the body tag.
Hi Jordy
You should be able to achieve this by using the ternary operator something like this
This should only add the class if your property is not empty otherwise the class will be empty.
Hope this hels (and works) :)
/Jan
is working on a reply...