1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Image selector in admin control template

Image selector in admin control template

5 posts, 1 answered
  1. Levi Burton
    Levi Burton avatar
    11 posts
    Registered:
    16 Apr 2010
    22 Jul 2010
    Link to this post
    I have an image selector in my custom control template that is used to select an image from images and documents library.  I am using sitefinity 3.6, but I think they may have upgraded from an earlier version because the image selector returns a path to the image and not an ID.

    The selector in my control template uses Sitefinity/UserControls/Libraries/LibrarySelector.aspx, which then appears to load Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx.  Is this correct for Sitefinity 3.6? 

    How can I use an image selector that returns an ID instead of a URL to the library item?

    In my control template, this is how I create the image selector:

     

     

     

    <%@ Register TagPrefix="uc" Src="../../../UserControls/Libraries/LibrarySelector.ascx" 
    TagName="LibrarySelector" %> 

     


    <uc:LibrarySelector ID="ImageFile" runat="server" Callbackfunction="FileCallBack" 
    DisplayMode="Image" />

     

     


     

     

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    22 Jul 2010
    Link to this post
    Hello Levi Burton,

    There is a ButtonSelector control that returns dynamic link.

    <%@ Register TagPrefix="sfLib" Namespace="Telerik.Libraries.WebControls" Assembly="Telerik.Libraries" %>
     
    <sfLib:ButtonSelector WindowNavigateUrl="~/Sitefinity/UserControls/Dialogs/DocumentEditorDialog.aspx" ItemTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/Dialogs/ButtonSelector.ascx" AssociatedControls="MyCustomControl" runat="server" cssclass="pickerWrapper" ButtonText="Select" />


    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  3. Levi Burton
    Levi Burton avatar
    11 posts
    Registered:
    16 Apr 2010
    22 Jul 2010
    Link to this post
    Thank you Ivan, that worked like a charm!  The only problem I'm having now is my document selection is limited to documents it seems -- it wont let me select an image from an Image library.

    Thanks for the lighting fast response!
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    22 Jul 2010
    Link to this post
    Hi Levi Burton,

    Use WindowNavigateUrl="~/Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx"

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Levi Burton
    Levi Burton avatar
    11 posts
    Registered:
    16 Apr 2010
    22 Jul 2010
    Link to this post
    Nevermind, figured it out.  Changed DocumentEditorDialog.aspx to ImageEditorDialog.aspx and everything is correct now.  Thanks again!
Register for webinar
5 posts, 1 answered