I'm attempting to write my first custom datatype, and one of the things I would like to do as part of the settings is have a content picker that allows me to pick the starting node of the DataType. I've worked out how to add standard form fields to the settings section, how would I go about adding an Umbraco control as a setting option? Does anyone have an example of doing this?
Thanks Dirk that's exactly what I was looking for, I thought it would be something like that, but I wasn't 100% sure, I'm still finding my way round the Umbraco controls and API!
Add Content Picker to DataType Settings
I'm attempting to write my first custom datatype, and one of the things I would like to do as part of the settings is have a content picker that allows me to pick the starting node of the DataType. I've worked out how to add standard form fields to the settings section, how would I go about adding an Umbraco control as a setting option? Does anyone have an example of doing this?
:)
Here's what I did for a similar project:
Add a placeholder control on your user control (eg. phContentPicker) in design view
Add this snippet to your code behind class:
on page load or page init, use:
to add the content picker control to the placeholder.
you can get the selected node via the .Text property.
Hope this helps.
Regards,
/Dirk
Thanks Dirk that's exactly what I was looking for, I thought it would be something like that, but I wasn't 100% sure, I'm still finding my way round the Umbraco controls and API!
:)
is working on a reply...