If I have a dropdownlist populated by a prevalue source with both a key and a value, how do I store the key rather than the value?
For example, I want my select list to display the list of US state names. The key in this case is the two digit state code. When my client exports their data to csv, they want the state code to be displayed, rather than the state name.
How can I do this? I guess I'm looking for something similiar to the Dropdown List, Publishing Keys datatype. I tried creating a new datatype, but contour doesnt pick them up. Any ideas?
Storing Prevalue Keys
If I have a dropdownlist populated by a prevalue source with both a key and a value, how do I store the key rather than the value?
For example, I want my select list to display the list of US state names. The key in this case is the two digit state code. When my client exports their data to csv, they want the state code to be displayed, rather than the state name.
How can I do this? I guess I'm looking for something similiar to the Dropdown List, Publishing Keys datatype. I tried creating a new datatype, but contour doesnt pick them up. Any ideas?
Thanks in advance.
Hi Jonathan,
I'm not sure how you want to populate the ddl but I use http://our.umbraco.org/projects/developer-tools/dropdown-with-sql-source
It is great for populating a ddl from a db with id and value.
Alternatively try one of the uComponents datatypes:
http://our.umbraco.org/projects/backoffice-extensions/ucomponents
hth
Jay
The standard components arent' available with contour. So I guess my only option is to use a custom datatype?
is working on a reply...