Copied to clipboard

Flag this post as spam?

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


  • Limberg Michelsen 22 posts 99 karma points
    Jul 01, 2014 @ 12:11
    Limberg Michelsen
    0

    Get selected dropdown values as a list

    I have searched the forum and Google for an answer for this, but no luck, so I'll try posting.

    I have a list of values like this:

    "Smá samfeløg"
    "stórbýir og globalisering"
    "Mentan, miðlar og samskifti"

    And I can get the value like this f.x.: @samfelagsfroding.GetProperty("oki").Value

    This gives me a comma seperated list like this: "Smá samfeløg,stórbýir og globalisering,Mentan, miðlar og samskifti" but the problem is that there are too many commas, as I have commas in the text. I would like to get the 3 selected values as a list - not as a comma seperated string. How can I do this?

    I can get all the possible values by using umbraco.library.GetPreValues(1050), but now I need the selected values for a specific node.

    I've found something about PrevaluesAsKeyValuePairList, which seems to be what I am looking for, but I can't find any documentation of how to use this exactly.

    Hope someone can help :)

    Thanks

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Jul 01, 2014 @ 13:12
    Jeavon Leopold
    0

    Hi Limberg,

    Yes the answer is to use "DropDown List Publishing Keys", the documentation and code samples for this editor are here

    Jeavon

Please Sign in or register to post replies

Write your reply to:

Draft