I really want to blog about adding DAMP to a custom page, but I didn't have the time for it yet. Here are some code samples which hopefully will help you.
//Add the [Digibiz] Select single media item datatype to the menu image placeholder.
_dampMenuImageDataEditor = (DAMP_DataEditor)((AbstractDataEditorControl)dampSingleMediaItemIdDatatype.DataType.DataEditor).Control;
_dampMenuImagePrevalueEditor = (DAMP_PrevalueEditor)dampSingleMediaItemIdDatatype.DataType.PrevalueEditor;
_dampMenuImageDataEditor.Load += new EventHandler(DampMenuImageDataEditor_Load);
PlaceHolderMenuImage.Controls.Add(_dampMenuImageDataEditor);
protected void DampMenuImageDataEditor_Load(object sender, EventArgs e)
{
int minimumNodesValue = _dampMenuImagePrevalueEditor.MinimumNodesValue;
int maximumNodesValue = _dampMenuImagePrevalueEditor.MaximumNodesValue;
//Set value from the database in the [Digibiz] Select single media item datatype.
_dampMenuImageDataEditor.Value = MenuImageValue;
//Set the validation values.
_dampMenuImageDataEditor.CheckValidation = CheckActive.Checked;
_dampMenuImageDataEditor.Mandatory = CheckActive.Checked;
_dampMenuImageDataEditor.MandatoryText = "The menu image in the tab needs a media item";
}
Remember that if you store your data as media xml the values don't get updated automatically if you change the media item in the media section. It's best to only store the id in the custom section unless you want to write a custom event which updates the media xml.
I have a DAMP control added to a custom usercontrol but can't seem to set the thumbnail width and height when the control first loads (page load). I have the following in my user control - am I missing something?
I am tryng to add DAMP in custom section of umbaraco 6.1.4 installation. The damp control is successfully rendered. but it is not working because the the javascript files needed for DAMP is not included. Can someone help specifcally which all javascript files needed for the damp to work ?
I got your point, all the javascript and styles for the DAMP control is included in the usercontrol itself. But when clicked the choose link i can see this error in the console: Uncaught ReferenceError: UmbClientMgr is not defined .
I guess I need to refer some javascript/css files that comes with umbraco in my custom page. Any help ?
DAMP 1.0 in custom page
Hello,
I've managed to add DAMP to a custom page by following the same code to add the TinyMCE control
but am unsure on how to access the properties exposed by the IMediaPicker interface in the source code.
Any help much appreciated.
Dan
Hello,
I really want to blog about adding DAMP to a custom page, but I didn't have the time for it yet. Here are some code samples which hopefully will help you.
Remember that if you store your data as media xml the values don't get updated automatically if you change the media item in the media section. It's best to only store the id in the custom section unless you want to write a custom event which updates the media xml.
Jeroen
Many thanks for the quick reply, I'll let you know how I get on with your examples.
Ok, I'm up and running.
It made me feel better that I was just a step away.
Thanks again for the help.
Hi Jeroen,
I have a DAMP control added to a custom usercontrol but can't seem to set the thumbnail width and height when the control first loads (page load). I have the following in my user control - am I missing something?
Thanks
Kenny
I am tryng to add DAMP in custom section of umbaraco 6.1.4 installation. The damp control is successfully rendered. but it is not working because the the javascript files needed for DAMP is not included. Can someone help specifcally which all javascript files needed for the damp to work ?
Thanks
Ajmal
The javascript/css files are added with ClientDependency. See here: https://damp.codeplex.com/SourceControl/latest#DigibizAdvanceMediaPicker/DigibizAdvancedMediaPicker.ascx
Jeroen
Hi Jeroen,
I got your point, all the javascript and styles for the DAMP control is included in the usercontrol itself. But when clicked the choose link i can see this error in the console: Uncaught ReferenceError: UmbClientMgr is not defined .
I guess I need to refer some javascript/css files that comes with umbraco in my custom page. Any help ?
You need to make sure your custom page inherits from the correct masterpage:
Than the UmbClientMgr should be available.
Jeroen
is working on a reply...
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.