enumeration field with display name?

Topics: Core, Customizing Orchard, General
Jul 9, 2015 at 1:55 PM
Hi,
If I use enumeration field, I can create a dropdown, but is there a way to display a value and display name pair?
for example:
0: no
1: yes
2: maybe

I found a module called Orchard Choice List Custom Field, which I can modify to achieve this. Just wondering if there are better ways.
Developer
Jul 9, 2015 at 2:26 PM
If you're using it with Custom Forms, then you could consider using Dynamic Forms instead. It also has an Enumeration field element which allows you to provide a list of key/value pairs.
Jul 9, 2015 at 2:41 PM
Hi,

Where can I find Dynamic Form? I found module form and custom form, but not Dynamic form.

Basically I just want a place that an admin user can modify a dropdown list (with value and display name), so it can be filled in by editors later.
Developer
Jul 9, 2015 at 3:53 PM
It's a new module released with Orchard 1.9. However, it is intended for creating forms for displaying on the front end, not within the admin. So in your case you'd want to use the Enumeration content field. Since that one doesn't support key/value pairs, you could create an issue on GitHub if you like - it seems useful enough.
Jul 9, 2015 at 4:02 PM
I just enhanced the Orchard Choice List module bit to include display name, works for me at least.