How to get the values of customize datatype multiple drop down list using Razor
Hi I am new to umraco and very new to Razor.
I have created a multiple drop down list. From admin panel user can select values of that drop down list in the content section. But now I need to get the values in that drop down list to be displayed on the web page. For this I am trying to create a macro using scripting files. I think I am doing fine till there.
Can any one tell me how i can get the values of custom datatype.
My document type name is Category, data-type name is also Category.
How to get the values of customize datatype multiple drop down list using Razor
Hi I am new to umraco and very new to Razor.
I have created a multiple drop down list. From admin panel user can select values of that drop down list in the content section. But now I need to get the values in that drop down list to be displayed on the web page. For this I am trying to create a macro using scripting files. I think I am doing fine till there.
Can any one tell me how i can get the values of custom datatype.
My document type name is Category, data-type name is also Category.
Thanks
Hi have some one need help I did it. I am pasting the sample code
@using umbraco.MacroEngines
@inherits DynamicNodeContext
@using System.Xml.XPath
@{
var baseNode = Model.AncestorOrSelf();
XPathNodeIterator iterator = umbraco.library.GetPreValues(8547);
iterator.MoveNext(); //move to first
XPathNodeIterator preValues = iterator.Current.SelectChildren("preValue", "");
foreach(var item in preValues)
{
preValues.MoveNext();
string preValue = preValues.Current.Value;
<ul >
<li>
@preValue
</li>
</ul>
}
Hi Abdul,
Have you have seen this documentation about the bulid-in property editors in Umbraco and how to get data out them using the DynamicNode razor syntax
And especially the documentation for the Dropdown-Multiple-Publish-Keys Editor and the Dropdown list multiple editor.
Hope this can help you a step further,
/Dennis
is working on a reply...