Copied to clipboard

Flag this post as spam?

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


  • Mark 10 posts 30 karma points
    Feb 24, 2011 @ 14:16
    Mark
    0

    Members: Custom Data Types and data storage of multi select items

    Hi There,

    I have set up a custom data type as a checkbox list, with database datatype of Nvarchar

    I then have assigned this to a member group and get the option when editing a member.

    However when I look at the data in the database (cmsContentXml) I can see that these values have been stored as text and not the prevalue ids as I was expecting:

    <cuisineType><![CDATA[Chinese,Indian,Japanese / Korean,Thai / Vietnamese]]></cuisineType>

    I am concerned that storing as text will cause issues if the name of a one of the options is changed.

    (I did try setting the datatype to integer, but this caused an error when saving the member.

    Any ideas?

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Feb 24, 2011 @ 14:57
    Tom Fulton
    0

    Hi,

    I think there are two types of checkboxlists to use, one is CheckBoxList and one is CheckBoxList (publishing keys).  I forget which one, but one stores the IDs and one stores the values.  So you might try the other one :)

    You can then retrieve the values from the ID using umbraco.library:GetPreValues

    -Tom

  • Mark 10 posts 30 karma points
    Feb 24, 2011 @ 15:21
    Mark
    0

    Hi Tom,

    Thanks, I had a look and under the render control option in the data type there is only one option "Checkbox List" (but there are publish key options for others such as "Dropdown list multiple, publish keys") I could use this at a push, but would prefer a checkbox list.

    Am I missing some of the "default" data types?  Im using version 4.6.1

    Thanks

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Feb 24, 2011 @ 15:31
    Tom Fulton
    0

    Sorry, I misspoke, you are right, the publish keys option isn't available for Checkbox Lists.  It looks like this is the intended behavior.

    I think you'd have to use the Dropdown list multiple if you want to achieve this without making a custom datatype.

    You could also use the Ultimate Picker, and store the options somewhere in the content tree outside of the main site.

    -Tom

  • Mark 10 posts 30 karma points
    Feb 24, 2011 @ 17:02
    Mark
    0

    Hi Tom,

    Thanks for the clarifcation. Multi DD will work for now. But will investigate Ultimate Picker too.

    Any ideas on my other post http://our.umbraco.org/forum/developers/extending-umbraco/17732-Members-List-search-on-front-end-Indexing-searching essentially these categories would be some of the options for searching by on the front end, and I need to make this as effient as possible,

    Thanks again.

Please Sign in or register to post replies

Write your reply to:

Draft