Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • bob baty-barr 1180 posts 1294 karma points MVP
    Oct 27, 2010 @ 02:53
    bob baty-barr
    0

    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?

  • Harald Ulriksen 207 posts 249 karma points
    Oct 27, 2010 @ 13:13
    Harald Ulriksen
    0

    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

  • bob baty-barr 1180 posts 1294 karma points MVP
    Oct 27, 2010 @ 15:50
    bob baty-barr
    0

    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?

  • Harald Ulriksen 207 posts 249 karma points
    Oct 27, 2010 @ 16:05
    Harald Ulriksen
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft