Copied to clipboard

Flag this post as spam?

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


  • andywilde 25 posts 66 karma points
    May 31, 2011 @ 18:38
    andywilde
    0

    media picker - get reference to selected item.

    I am creating a user control to select multiple images an then store their id's (along with other textual data) in an xml block. I have included a media picker in my control using: 

    private umbraco.editorControls.mediaChooser _mediapicker;

    umbraco.cms.businesslogic.datatype.DataTypeDefinition dataTypeDefinition1 = umbraco.cms.businesslogic.datatype.DataTypeDefinition.GetDataTypeDefinition(1035);

    umbraco.editorControls.mediaChooser _mediapicker = (umbraco.editorControls.mediaChooser)dataTypeDefinition1.DataType.DataEditor; myPanel.Controls.Add(_mediapicker);

    This works fine and displays the selected item's name in the control.

    How do I get a client side reference to the returned item so that I can use javascript to add it to my listbox?

  • aghy 129 posts 308 karma points
    May 31, 2011 @ 18:57
    aghy
    0

    Hi Andy,

    Have a look at MultiType DataType

    You could add a media picker and textbox in the datatypes section and then add as many (or set a limit) images and text as you want in the content section. They will be saved as xml which you can then display on your website using xslt.

    It's really easy to use and if you need any help just let me know!

    Thanks
    Ben

  • Daniel Bardi 927 posts 2562 karma points
    May 31, 2011 @ 18:58
    Daniel Bardi
    0

    Selected item will be stored as the id of the media item on the save event of the datatype... 

    Why not use the ultimate picker or multinode picker?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    May 31, 2011 @ 20:14
    Jeroen Breuer
    0

    If you want to select multiple images you can also use the Digibiz Advanced Media Picker for this.

    Jeroen

  • andywilde 25 posts 66 karma points
    May 31, 2011 @ 22:07
    andywilde
    0

    Thanks very much for the advice, I'll try out what you all suggest and see which solution best suits my requirements.

    Hopefully I won't need to reinvent the wheel

Please Sign in or register to post replies

Write your reply to:

Draft