populate option and value from nodes - is that possible
here is what i would like to do... i want to have my client be able to create 'site contacts' in the content tree and use those nodes to populate a dropdown in Contour... however, i want the option to be the department name and the value to be the email address which is a property of the department...
Absolutley, create a prevalue source and set the type to Umbraco Documents. You can then select a root node or use xpath statement as well as limit it to certain doc types. You can also configure a umbraco datatype and set the prevalue type to Umbraco data type Prevalues.
The last option is writing your own prevalue type. This is more work, but will also offer more flexibility - I ended up doing this as I needed some extended checks.
i understand the prevalue source using the nodes... but can i have two values??? meaning the nodeName would be the text in teh dropdown, but an email address for example would be the option value of the dropdown??? does that make sense?
Makes sense but I think you will need a custom prevalue type for that. If you look at the xml for a prevalue field you can see that it saves a key, normally the prevalue guid or a node id, and a value. If you write your own prevalue type you can set the id to the mail address.
Depending on how you plan to use the e-mail adress it might be an option to retrieve it based on the id later on.
populate option and value from nodes - is that possible
here is what i would like to do... i want to have my client be able to create 'site contacts' in the content tree and use those nodes to populate a dropdown in Contour... however, i want the option to be the department name and the value to be the email address which is a property of the department...
how would i go about doing this?
Absolutley, create a prevalue source and set the type to Umbraco Documents. You can then select a root node or use xpath statement as well as limit it to certain doc types.
You can also configure a umbraco datatype and set the prevalue type to Umbraco data type Prevalues.
The last option is writing your own prevalue type. This is more work, but will also offer more flexibility - I ended up doing this as I needed some extended checks.
Hth,
Harald
i understand the prevalue source using the nodes... but can i have two values??? meaning the nodeName would be the text in teh dropdown, but an email address for example would be the option value of the dropdown??? does that make sense?
Makes sense but I think you will need a custom prevalue type for that. If you look at the xml for a prevalue field you can see that it saves a key, normally the prevalue guid or a node id, and a value. If you write your own prevalue type you can set the id to the mail address.
Depending on how you plan to use the e-mail adress it might be an option to retrieve it based on the id later on.
h.
is working on a reply...