Single Selection List Items - If Statement Format for .cshtml file
Hello Everyone! I'm using v4.7..
I am trying to allow my users to link a (Location & Link to a Map) to each individual blog post. I am using uBlogsy and am trying to update the (uBlogsyShowPost.cshtml) file.
I have created a dataType called Locations as you can see below.
Now below I have kind of a sample of code that expresses how I would like to have it. Where I create a varible from my dataType (uBlogsylocationPicker) and if the value is equal to 64 then it displays name of the building as well as a customized link for that specific building.
@{ if (Model.NodeTypeAlias == "uBlogsyPost"){ var uBlogsyLocate = @d.GetProperty("uBlogsylocationPicker");
Single Selection List Items - If Statement Format for .cshtml file
Hello Everyone! I'm using v4.7..
I am trying to allow my users to link a (Location & Link to a Map) to each individual blog post. I am using uBlogsy and am trying to update the (uBlogsyShowPost.cshtml) file.
I have created a dataType called Locations as you can see below.
Now below I have kind of a sample of code that expresses how I would like to have it. Where I create a varible from my dataType (uBlogsylocationPicker) and if the value is equal to 64 then it displays name of the building as well as a customized link for that specific building.
However this doesn't work. I always get an error that says..
[....Operator '==' cannot be applied to operands of type 'umbraco.interfaces.IProperty' and 'string']
How can I make this happen? is there a better way?
Thanks in advance for your help!
I haven't done this myself, but it looks like you could try:
to get you where you want. I would surmise that ToString() for IProperty will return the value of that property.
Nice, thanks Brian.. I had to change it to this:
instead of the numeric value.. but thats fine with me.
is working on a reply...