I'm sure this is a simple question but was not able to find anything on initial searching. How can I access the data values from a partial view?
When Umbraco native data types I could do something like:
// Get data type id
var dataTypeId = 1234;
var preValues = PreValues.GetPreValues(dataTypeId).Values;
var enumerator = preValues.GetEnumerator();
<div class="datatype-items">
<ul>
@while (enumerator.MoveNext())
{
// Get List Item Value
var category = ((umbraco.cms.businesslogic.datatype.PreValue)enumerator.Current).Value;
// Output item name
<li>@category</li>
}
</ul>
</div>
There's a strongly typed Picker object that returns the picked items, but unfortunately it doesn't have a property to return the source collection (issue on github)
Access DataType values from partial view
I'm sure this is a simple question but was not able to find anything on initial searching. How can I access the data values from a partial view?
When Umbraco native data types I could do something like:
Many thanks in advance!
Hi John
Do you want to get data of some Umbraco node?
Datatypes don't store values of data, this is only type of possible data in Umbraco node
How to get data from nodes read here - https://our.umbraco.org/documentation/reference/templating/mvc/querying
Thanks
Alex
Hi John,
There's a strongly typed Picker object that returns the picked items, but unfortunately it doesn't have a property to return the source collection (issue on github)
is working on a reply...