|
|
Rank: Devotee
Joined: 5/2/2008 Posts: 52 Location: Herning, Denmark
|
Hi,
Im doing a ad rotator for umbraco and are looking into different options on how to develop it. One of the ideas is to make a usercontrol and add it to the tabs in the administration area. But one of the things i need to this admin module is the abillity to select a media node from the umbraco system. But how to do that? Is it possible to use the media picker control and render that somehow in my usercontrol?
|
|
 Rank: Devotee
Joined: 12/6/2007 Posts: 61
|
Have a look at this thread. http://forum.umbraco.org/yaf_postst1794_anybody-have-any-thoughts-on-a-banner-rotator-system.aspx - if this doesn't help please let me know. Thanks, Matthew
New Zealand Umbracoee
|
|
Rank: Enthusiast
Joined: 1/7/2008 Posts: 37
|
You can call media picker via javascript call in your code. Check sources of the media picker umbraco data type.
|
|
Rank: Devotee
Joined: 5/2/2008 Posts: 52 Location: Herning, Denmark
|
Where in the source code/files to find the media picker source?
|
|
Rank: Devotee
Joined: 5/2/2008 Posts: 52 Location: Herning, Denmark
|
By the way, i have submitted to get notifications on this post but didnt get any. My email address is the right one. Something wrong with the forum?
|
|
 Rank: Addict
Joined: 9/27/2007 Posts: 977 Location: Belgium
|
Hi, Notifications do not work as intended. Might get mutiple notifications at once, or none at all. It's just not working as it should. Just don't rely on it! Solution to this is to watch the 'Active topics', at leats that's what I do.. Greetz, /Dirk
level 1 certified - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
|
|
Rank: Devotee
Joined: 5/2/2008 Posts: 52 Location: Herning, Denmark
|
Great :)
Found the media picker control, but now i have another question :) In the constructor it tages a IData as a parameter. What could i through after it? :)
|
|
Rank: Enthusiast
Joined: 1/7/2008 Posts: 37
|
Burla wrote:Where in the source code/files to find the media picker source? See file \components\editorControls\mediapicker\MediaPickerDataType.cs. In short - you must register necessary scripts and add generated as string javascript to the usercontrol control tree.
|
|
Rank: Devotee
Joined: 5/2/2008 Posts: 52 Location: Herning, Denmark
|
But i dont want to do all that javascript if i can only call the constructor for the mediaChooser (as it inherit from hiddenfield) and add it to my control. But i need to give the constructor a IData parameter but dont know what to send to it. Anyone got an idea?
|
|
Rank: Enthusiast
Joined: 1/7/2008 Posts: 37
|
mediaChooser is the editor control for the data type. IData is responsible for storing data type state. So dont sure that it can be used as the origignal user control. May be try to create some fake IData realization - but not sure.Why you cant use it as datatype?
|
|
Rank: Devotee
Joined: 5/2/2008 Posts: 52 Location: Herning, Denmark
|
Because im doing a admin module that dosent use the node structure in umbraco. But i still need to be able in my admin module to choose a image from umbraco. Quote:May be try to create some fake IData realization Yes is a good idea, any got an idea of what fake data i could send to the constructor?
|
|
Rank: Enthusiast
Joined: 1/7/2008 Posts: 37
|
Create simple class which implement IData interface- than add mediachooser control to yours with this class as constructor parameter. In the button handler call Save() method of the mediachooser control beforeadding your logic. Thats all - property Text will contain id of the media node. It is work for me.
|
|
|
Guest |