Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi, im trying to create an if statement on a true false field. But its driving me mad... i keep getting errors and i dont quite understand how this works. Can someone please help me
ive created a truefalse field named rolstoel. in my template i try:
@if(Umbraco.Field.GetPropertyValue("rolstoel")==true) { <li><i class="icon_set_1_icon-13"></i>Toegankelijk</li> }
Thanks Jaco
Hi Jaco.
So the problem is that "GetPropertyValue" returns a object, and you are comparing it against a boolean.
Try the following:
@if (Model.Content.GetPropertyValue<bool>("rolstoel")) { <li><i class="icon_set_1_icon-13"></i>Toegankelijk</li> }
Best of luck!
Great!!, this works perfect.Thank you very much Dennis!
Awesome jaco! Glad I could help!
Have a great day!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Using TrueFalse
Hi, im trying to create an if statement on a true false field. But its driving me mad... i keep getting errors and i dont quite understand how this works. Can someone please help me
ive created a truefalse field named rolstoel. in my template i try:
Thanks Jaco
Hi Jaco.
So the problem is that "GetPropertyValue" returns a object, and you are comparing it against a boolean.
Try the following:
Best of luck!
Great!!, this works perfect.Thank you very much Dennis!
Awesome jaco! Glad I could help!
Have a great day!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.