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
When using a default Umbraco dropdown on a document type, if I then show its value on the template eg
@Umbraco.Field("Category")
it correctly shows me the 'Text' of the selected item even though it saves the arbitrary value in the underlying database.
That is, the template somehow looks up the value from the prevalues and shows that.
I have created a custom property editor for a drop down with prevalues where I specfiy the value for each option in the controller.
Now showing this field in the template displays the value eg "1" rather than the selected text eg "Category a"
Is there any way of programatically retrieving the prevalues so I can do a conversion in the template or am I resigned to hard coding this?
Hi Tim,
Maybe this can help you:
umbraco.library.GetPreValueAsString(Convert.ToInt32(id))
Thanks
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Dropdown text not value in template (custom property editor)
When using a default Umbraco dropdown on a document type, if I then show its value on the template eg
@Umbraco.Field("Category")
it correctly shows me the 'Text' of the selected item even though it saves the arbitrary value in the underlying database.
That is, the template somehow looks up the value from the prevalues and shows that.
I have created a custom property editor for a drop down with prevalues where I specfiy the value for each option in the controller.
Now showing this field in the template displays the value eg "1" rather than the selected text eg "Category a"
Is there any way of programatically retrieving the prevalues so I can do a conversion in the template or am I resigned to hard coding this?
Hi Tim,
Maybe this can help you:
Thanks
is working on a reply...