We have a requirement to give a client a contour DropDownList type field, where they can choose their own values/IDs for the dropdown options. For example, if they have a dropdown option of "Lorem Ipsum", they want to set the underlying value to "XYZ".
We use a "Save as file" XML workflow that allows the client to bring in various different types of form entry into their 3rd party system. This is a bit oldschool but even if we used the Data Source - Webservice WSDL method (which neither we not the client have experience with) I believe we would have exactly the same problem. The 3rd party system needs the appropriate underlying values for field entries and not their human-friendly text value.
I was unable to find a way to import prevalue sources that let you choose the ID - the only option I can see would be to create a database table of the key/value pairs, but this would not work as we would need to create a table for every single different type of list (and there are many and the point is to make this all CMS-editor powered). Likewise with using a DataType - they wouldn't be editable by the CMS editors and they don't let you set the ID either. We ideally need something re-usable that will solve this problem and then we have a great solution for the long-term.
Any suggestions? We wondered if we might find the source for the existing DropDownList FieldType and then modify it to take in custom IDs for each option.
DropDownList FieldType with custom values (IDs)
Hi there,
We have a requirement to give a client a contour DropDownList type field, where they can choose their own values/IDs for the dropdown options. For example, if they have a dropdown option of "Lorem Ipsum", they want to set the underlying value to "XYZ".
We use a "Save as file" XML workflow that allows the client to bring in various different types of form entry into their 3rd party system. This is a bit oldschool but even if we used the Data Source - Webservice WSDL method (which neither we not the client have experience with) I believe we would have exactly the same problem. The 3rd party system needs the appropriate underlying values for field entries and not their human-friendly text value.
I was unable to find a way to import prevalue sources that let you choose the ID - the only option I can see would be to create a database table of the key/value pairs, but this would not work as we would need to create a table for every single different type of list (and there are many and the point is to make this all CMS-editor powered). Likewise with using a DataType - they wouldn't be editable by the CMS editors and they don't let you set the ID either. We ideally need something re-usable that will solve this problem and then we have a great solution for the long-term.
Any suggestions? We wondered if we might find the source for the existing DropDownList FieldType and then modify it to take in custom IDs for each option.
I just came across this, source code for some basic field types including the DropDownList.
http://our.umbraco.org/projects/developer-tools/umbraco-contour-shared-source
It's from 2010, but hopefully it should provide a good base.
Comment author was deleted
You can find the latest source for all default providers on the contour project page, sourcecode tab
Thanks Tim, that's super. Didn't see those there.
is working on a reply...