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

Forums / 3.x Pre-release forums (retired) / EditorTemplate.ascx configuration

EditorTemplate.ascx configuration

2 posts, 0 answered
  1. fregas baratis
    fregas baratis avatar
    185 posts
    Registered:
    14 Nov 2002
    08 Mar 2007
    Link to this post
    Hello

    i was trying to configure the RadEditor's ImagePaths, UploadPaths, etc. so that my users can upload content.  By searching the forums, i found the EditorTemplate.ascx for the generic content control.  However, in my case, I would like to programatically set these properties to all use the same directory, which i would like defined in the web.config.  Is there a way i can programmatically do this?  I was able to get to the codebehind for the editor in Sitefinity 2.7 but there's no codebehind here.

    This is also another instance where having the source code to the modules would help a lot.

    Thanks,
    Craig
  2. Bob
    Bob avatar
    330 posts
    Registered:
    24 Sep 2012
    09 Mar 2007
    Link to this post
    Hello Craig,

    EditorTemplate.ascx is the default layout template for the content tab in the GenericContent’s properties window. The path to this template is specified for each provider in the web.config file. You can also override this path by setting the EditorTemplatePath property of GenericContronent control. This way you can use different templates for different instances.

    Here is an example how to access the editor programmatically:

    In the Admin folder find and open the CtrlProps.aspx.cs file.
    Add the following code:

    protected override void OnPreRender(EventArgs e)
    {
        
    base.OnPreRender(e);
        
    RadEditor editor = Telerik.Web.UI.ControlHelper.GetChildControl<RadEditor>(this);
        
    if (editor != null)
            
    editor.ImagesPaths = new string[] { "~/Images" };
    }

    All the best,
    Bob
    the telerik team
2 posts, 0 answered