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:
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
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
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?
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
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
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
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.
is working on a reply...