Copied to clipboard

Flag this post as spam?

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


  • David W. 159 posts 284 karma points c-trib
    Oct 08, 2010 @ 15:26
    David W.
    0

    Custom datatype - key/value dropdownlist

    Hello,

    I'm looking to create a DataType that should work as a key/value dropdownlist, but when I try to create one (using dropdown list as "Render control") I seem to only be allowed to edit the 'Text'. The 'Value' gets an integer automatically assigned.

    I want to use the dropdown so that editors can choose a 'style' for a certain document type. I want the text in the ddl to be Green, Blue and Red, and I would like theit corresponing value to be something like myGreenCssClass, myBlueCssClass etc. This so I can use 

    <xsl:value-of select="./data[@alias = 'myCssColorProperty']"/> 

    in a xslt macro. Can I achieve this?

  • Mike Chambers 636 posts 1253 karma points c-trib
    Oct 08, 2010 @ 23:44
    Mike Chambers
    0

    Think this is what you are looking for,,,

    http://www.richardsoeteman.net/CommentView,guid,24E1D561-1F6C-4411-BD62-584023D31DF7.aspx#c97c0910-13e7-4d21-88a4-aaae18e44043

    specifically look at the line

     this.Items.Add(new ListItem("Title", "nodeName"));

    eg new ListItem(Text, Value)

    I discovered it linked from http://our.umbraco.org/wiki/how-tos/how-to-create-a-custom-macro-parameter-type

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies