More in this section

Forums / Developing with Sitefinity / Insert Document with multiple library Providers

Insert Document with multiple library Providers

9 posts, 1 answered
  1. Webteam
    Webteam avatar
    28 posts
    Registered:
    30 Nov 2009
    29 Apr 2010
    Link to this post
    I am using sitefinity 3.7 and have two providers setup for my libraries, one that is specific to the site, and one that is shared between multiple sites. 

    When a user is adding/editing generic content and clicks on the insert document link it brings up the image library dialogue but only lists the libraries from whichever provider is set as default.  There is no way for them to switch to the other provider to select a document. 

    I realize you could accomplish this by manually adding the url however I can't expect the users to do this, and it seems a little pointless to allow multiple providers if there is no support for it within the interfaces. Has anyone else come across this limitation and has recomendations as to how to fix or work around it?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    30 Apr 2010
    Link to this post
    Hello David Desjardins,

    There is not implementation for this in our dialogs. You have to create a custom dialog which has a DropDown that switches the provider. I have provided sample implementation in this forum post - Library Provider Help

    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. Webteam
    Webteam avatar
    28 posts
    Registered:
    30 Nov 2009
    30 Apr 2010
    Link to this post
    that's perfect, thanks for the quick response
  4. Webteam
    Webteam avatar
    28 posts
    Registered:
    30 Nov 2009
    03 May 2010
    Link to this post
    Hi,

    I joyed too early.  We just cannot get it to work.  We tried overriding entries in the web.config, then in ControlsConfig.xml, but no luck.  Could you please point us to the right direction?

    Thanks,
    David
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    04 May 2010
    Link to this post
    Hello David Desjardins,

    The implementation does not require changing the web.config or ControlsConfig file. The sample shows how ti implement custom dialog and then tell to ~/Sitefinity/UserControls/Dialogs/DocumentEditorDialog.aspx  dialog template to use it instead of the default one.

        <title>Insert Document</title>
        <link type="text/css" rel="stylesheet" href="~/Sitefinity/UserControls/Dialogs/CustomDialogs.css" />
        <link type="text/css" rel="stylesheet" href="~/Sitefinity/UserControls/Dialogs/RadControlsSkins.css" />
        <link type="text/css" rel="stylesheet" href="~/sitefinity/admin/Themes/Default/CustomDialogs.css" />
        <link type="text/css" rel="stylesheet" href="~/sitefinity/admin/Themes/Default/RadControlsSkins.css" />
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
         
            <asp:ScriptManager id="ScriptManager" runat="server"/>
            <cc:CustomImageEditorDialog runat="server" DisplayMode="Documents" />
         
        </div>
        </form>
    </body>
    </html>


    Kind 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.
  6. Webteam
    Webteam avatar
    28 posts
    Registered:
    30 Nov 2009
    05 May 2010
    Link to this post
    Thank you Ivan,

    We are getting there slowly.  Now, we still don't see our two providers (shared and site specific) dropdown.  Where do we need to set this up?
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    05 May 2010
    Link to this post
    Hi David Desjardins,

    Please share the code you use.

    Best wishes,
    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.
  8. Webteam
    Webteam avatar
    28 posts
    Registered:
    30 Nov 2009
    05 May 2010
    Link to this post
    Hi Ivan,

    We simply used the code you sent in this message: http://www.sitefinity.com/support/forums/sitefinity-3-x/developing-with-sitefinity/library-provider-help.aspx (your last reply).

    thx!
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    05 May 2010
    Link to this post
    Hello David Desjardins,

    Modify ~/Sitefinity/Admin/ControlTemplates/Libraries/Dialogs/ItemSelector.ascx and add DropDownList or RadComboBox control there.

    <asp:Repeater runat="server" ID="librariesList">
                <HeaderTemplate>
                    <h2>Open a library</h2>
                    <p class="gotoLibraryModules">Here you select images you have uploaded in Modules > <a id="A1" href="~/Sitefinity/Admin/Modules.aspx?module=Libraries" runat="server" rel="external">Images&Documents</a></p>
                    <ul class="selectLibrary">
                      
                    <asp:DropDownList runat="server" ID="ProvidersDropDownList" AutoPostBack="true"></asp:DropDownList>
                </HeaderTemplate>

    Create a class that inherits ItemSelector. Find the DropDownList control from the template and bind it to a list of providers. Set AutoPostBack of the drop down  to true.

    Greetings,
    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.
Register for webinar
9 posts, 1 answered