@{
IPublishedContent typedContentPicker = Model.Value<IPublishedContent>("contentPicker"); //contentPicker is the alias name
if (typedContentPicker != null)
{
<p>@typedContentPicker.Name</p>
}
}
And what do you see if you change the code to this :
@{
IPublishedContent typedContentPicker = Model.Value<IPublishedContent>("contentPicker"); //contentPicker is the alias name
if (typedContentPicker != null)
{
<p>@typedContentPicker.Name</p>
}
else {
<p>No content found from picker</p>
}
}
reading content picker property in Umbraco 8.
Hi,
I followed the below url and could not read content picker. Does Umbraco 8 support content picker?
https://our.umbraco.com/documentation/getting-started/backoffice/property-editors/built-in-property-editors/content-picker/
Hello, Nagarjun
Get the value of content picker property, To use the ID on your page, you need to write some code similar to
For content:
For Images:
See
https://our.umbraco.com/documentation/reference/querying/umbracohelper/#working-with-media
for more details on this.
Hi Nagarjun,
You code seems correct. Do you get any errors ?
And what do you see if you change the code to this :
Hi Dave,
Right now, it is not entering into if condition. it always returns null. I use version 8.6.4
I used sample site that comes with umbraco site and tried to add 'contact' page as content picker in blog page.
Hi,
Yes, Umbraco 8 supports content picker.
Check please that you really have that value, property alias and are you using content picker as datatype?
Thanks,
Alex
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.