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

Forums / Designing with Sitefinity / Embedding an External Template

Embedding an External Template

5 posts, 0 answered
  1. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    01 Jul 2010
    Link to this post
    How can I use one of the external templates embedded into a custom assembly and load that...as a designer attribute on my custom class?

    I've inherited from an existing control, and want to change its default designer (the GC Editor)...is there an override to specify the designer template to use?  Or do I need to make another class that inherits from the Designer Class then set the template there?

    So I have the GenericContentDesigner.ascx embedded right now, just not sure what to do with it...
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    01 Jul 2010
    Link to this post
    Hello Steve,

    There is an attribute called ControlDesignerAttribute which is used to make reference to a custom designer

    [ToolboxItem(typeof(GenericContentToolboxItemCustom))]    [ControlDesignerAttribute("Telerik.Samples.Design.GenericContentDesignerCustom, Telerik.Samples")]
        public class GenericContentCustom : GenericContent
         {
     
         }


    designer code

    GenericContentDesignerCustom : Telerik.Framework.Web.Design.ControlDesigner
    {
     
         [WebSysTemplate(GenericContentDesignerCustom
    .layoutTemplateName, "GenCntDesigner_LayoutTemplate_Desc"
                , "/Generic_Content/", false, "2008-11-16")]
            public override string LayoutTemplatePath
            {
                get
                {
                    return base.LayoutTemplatePath;
                }
                set
                {
                    base.LayoutTemplatePath = value;
                }
            }
     
            /// <summary>
            /// Gets the name of the embedded layout template.
            /// </summary>
            protected override string LayoutTemplateName
            {
                get
                {
                    return GenericContentDesignerCustom.layoutTemplateName;
                }
            }
    }


    All the best,
    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
  3. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    01 Jul 2010
    Link to this post
    Ok, so I cant just tell it to use that template then, it needs it's own designer class which references the template?

    Thanks :D
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    01 Jul 2010
    Link to this post
    Hi Steve,

    If this is a custom control, you cannot set just a template. Generally the only reference to the designer is ControlDesignerAttribute. There is not a public property that you can use the set the template of the Control Designer through a control.

    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
  5. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    01 Jul 2010
    Link to this post
    Darn okay

    It inherits from GenericContent, I was just hoping that I could sneak it in somehow, thanks :)
Register for webinar
5 posts, 0 answered