Im interested in rendering custom datatypes in my content templates.
Say for instace i have a datatype with property editor dropdown list and a set of prevalues. I would like to render a dropdown list with those prevalues with an easy command so that i can then later change the type from a dropdown to something else and have my template be affected by the change without having to update any markup.
This would then be used to build a search-module where user can apply filters by selecting values from dropdown lists, checkboxes etc.
Any ideas on where to begin? Ive been able to render a dropdownlist with the appropriate values but i would like to be able to dynamically change that dropdown-list to something else in the future.
Render a custom datatype
Hello.
Im interested in rendering custom datatypes in my content templates.
Say for instace i have a datatype with property editor dropdown list and a set of prevalues. I would like to render a dropdown list with those prevalues with an easy command so that i can then later change the type from a dropdown to something else and have my template be affected by the change without having to update any markup.
This would then be used to build a search-module where user can apply filters by selecting values from dropdown lists, checkboxes etc.
Any ideas on where to begin? Ive been able to render a dropdownlist with the appropriate values but i would like to be able to dynamically change that dropdown-list to something else in the future.
This is my current setup:
@helper fillDropDown(int thisPreValue) { XPathNodeIterator preValueRootElementIterator = umbraco.library.GetPreValues(thisPreValue); preValueRootElementIterator.MoveNext(); XPathNodeIterator preValueIterator = preValueRootElementIterator.Current.SelectChildren("preValue", ""); <div> <select name="type"> @while (preValueIterator.MoveNext()) { <option value="@preValueIterator.Current.Value" @if(@Request["type"] == @preValueIterator.Current.Value) { @Html.Raw("selected"); }> @preValueIterator.Current.Value </option> } </select> </div> }Thank in advance.
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.