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
We had a PartialViewMacroPage where we checked values in an Umbraco.CheckboxList as follows, which no longer works in version 8.
PartialViewMacroPage
Umbraco.CheckboxList
@if (Model.Content.Value<string> ("myCategoryList") .Split(',') .Contains("No Search")) { <meta name="robots" content="noindex, nofollow, noarchive, nosnippet" /> }
At the moment, the only thing I can find that might help is to assign the value to a variable and then check it using this code:
var myValue = @Model.Content.GetProperty("myCategoryList").GetSourceValue()
Has anyone any experience of PreValues in Umbraco 8?
Thanks
Muiris
Try the following thread.
Many thanks Gary, but I'm not trying to list the prevalues from the data type itself.
Hi,
the PreValues are returned as an enumeration in the model.
I used the below to create a dropdown list of selected Category's
<select>@foreach(var item in Model.Category){<option>@item.ToString()</option>}</select>
Hi everyone,
I think the problem you are facing is the Model.Content part. In Umbraco 8, you access properties like this:
Model.Content
// strongly typed Model.MyCategoryList // dynamic Model.Value<string>("myCategoryList")
So the "Content" property does no longer exist.
-Jonathan
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
PreValues
We had a
PartialViewMacroPage
where we checked values in anUmbraco.CheckboxList
as follows, which no longer works in version 8.At the moment, the only thing I can find that might help is to assign the value to a variable and then check it using this code:
Has anyone any experience of PreValues in Umbraco 8?
Thanks
Muiris
Try the following thread.
Many thanks Gary, but I'm not trying to list the prevalues from the data type itself.
Muiris
Hi,
the PreValues are returned as an enumeration in the model.
I used the below to create a dropdown list of selected Category's
Hi everyone,
I think the problem you are facing is the
Model.Content
part. In Umbraco 8, you access properties like this:So the "Content" property does no longer exist.
-Jonathan
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.