More in this section

Forums / Developing with Sitefinity / Someone created personalized folders using Generics Modules

Someone created personalized folders using Generics Modules

2 posts, 0 answered
  1. Pierre
    Pierre avatar
    433 posts
    16 Feb 2006
    21 Oct 2008
    Link to this post

    Someone has created personalized folders using Generic Contents like Title, Author at run time?.  I use ImageManager /document manager standard alone or similars tools. I have tried with inputs hidden and server side but I'm not bee able to catch in the cycle of page and cotrol creation the value. Only folders by Username and other statics are possible but is not solution for complexe storages.
    Someone have one solution to create on the fly when open ImageManager from ControlPanelInsert page?.  
    I have posted many times this issue in tickets but no issue.

    Here the full Code

    Inside in Generic Modules  ASPX ( ControlPanelInsert )
    <%@ Register TagPrefix="iv1" Src="~/Sitefinity/Admin/ControlTemplates/News/ImageCaller.ascx" TagName="ImageCaller" %> 

    bottom remplace old select thumbnail by ImageCaller
    <li class="selector">  
    <asp:Label ID="Labelimg" AssociatedControlID="Image1" runat="server">  
    <asp:Literal ID="Literalimg" runat="server" Text="Image 1"></asp:Literal> 
    <em id="imgLabel" runat="server"></em></asp:Label> 
    <v1:ImageCaller ID="Image1" runat="server" /> 
    <asp:Literal ID="LtNoteImg" runat="server" Text="Select your image"></asp:Literal></p>  
    don't forget Image1 is our metafield registred in the web.config metakeys.

    Catch the Value from Title to send to one input hidden Server side
    Somewhere under Image1 or inside the control but no catch as possible.

    <input id="titleHidden" type="hidden" runat="server" />

    The ImageCaller  with 2 inputs hidden as test  and the code

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ImageCaller.ascx.cs" Inherits="ImageCallerN" %> 
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>   
        <script type="text/javascript">  
        var currentTextBoxID;    
        function ImageManagerFunction(sender, args)    
            var selectedItem = args.SelectedItem;    
            var resultImageObject = args.Result;    
            var txt = $get(currentTextBoxID);    
            txt.value = selectedItem.getPath();    
        function SeeTitle()  
            var titleHidden = document.getElementById('<%= TitleValueField.ClientID %>');   
            var contitle=document.getElementById("ctl00_ContentPlaceHolder1_contolPanel_ctl00_ctl00_Title");            
            //var htitle=document.getElementById("ctl00_ContentPlaceHolder1_contolPanel_ctl00_ctl00_editMetaFields_ctl00_ImgVideo1_hiddenTitle");  
            var htitle=document.getElementById("<%= hiddenTitle.ClientID %>");   
            titleHidden.value =contitle.value;  
        <asp:HiddenField runat="server" ID="TitleValueField" />   
        <input id="hiddenTitle" type="hidden" runat="server" /> 
        <asp:TextBox ID="Linkthumb" runat="server"></asp:TextBox> 
        <telerik:dialogopener runat="server" id="DialogOpener1">    
       <button onclick="SeeTitle();currentTextBoxID='<%= Linkthumb.ClientID %>';$find('<%= DialogOpener1.ClientID %>').open('ImageManager');return false;">Select</button>   

    and code
    using Telerik.Web.UI;  
    using Telerik.Web.UI.Editor.DialogControls;  
    using Telerik.Security;  
    using Telerik.Cms.Engine;  
    public partial class ImageCallerN : System.Web.UI.UserControl,ITextControl  
        protected void Page_Load(object sender, EventArgs e)  
            string Title = hiddenTitle.Value; // The Hidden Value to create a Folder  
            // use titleHidden or hiddenTitle but no issue
            FileManagerDialogParameters dialogParameters1 = new FileManagerDialogParameters();  
            dialogParameters1.ViewPaths = new string[] { "~/MyFolder/"+Title+"/"};  
            dialogParameters1.UploadPaths = new string[] { "~/MyFolder/"thumbnails"/" };  
            dialogParameters1.DeletePaths = new string[]{ "~/MyFolder/"+Title+"/" };  
            dialogParameters1.MaxUploadFileSize = 5000000;  
            DialogDefinition imageManager = new DialogDefinition(typeof(ImageManagerDialog), dialogParameters1);  
            imageManager.ClientCallbackFunction = "ImageManagerFunction";  
            imageManager.Width = Unit.Pixel(694);  
            imageManager.Height = Unit.Pixel(440);  
            DialogOpener1.DialogDefinitions.Add("ImageManager", imageManager);  
        #region ITextControl Members  
        string ITextControl.Text  
                return this.Linkthumb.Text;  
                this.Linkthumb.Text = value;  

    What other event to create this ImageCaller only when button is pushed ( Page Load the input hidden are emply)

    Any help are wellcome but no political response please only code.

  2. Georgi
    Georgi avatar
    3583 posts
    28 Oct 2016
    31 Oct 2008
    Link to this post
    Hello Pierre,

    We discussed this in the rest of the support and forum threads already. We will be glad if someone from the community has a word on this.

    Kind regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
2 posts, 0 answered