More in this section

Forums / Developing with Sitefinity / How to specify section name in a custom pluggable control?

How to specify section name in a custom pluggable control?

4 posts, 0 answered
  1. Damir
    Damir avatar
    22 posts
    Registered:
    24 Nov 2008
    02 Nov 2009
    Link to this post
    When creating custom pluggable controls, you get all those attributes to specify default property, control name etc. but i haven't found a way to specify the section name.

    When the control is then uploaded as .dll sitefinity creates the control in a blank section name:

            <add name="ContentSlider" section="" type="InfinyDev.Controls.ContentSlider,InfinyDev.Controls, Version=0.0.2.1, Culture=neutral, PublicKeyToken=null" 
              description="" /> 
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    02 Nov 2009
    Link to this post
    Hello Damir,

    In the control TollboxItem when you initializes an instance of the tollbox item class call base.Section. The property gets or sets the section in which the control would be contained in the toolbox when editing a page.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Damir
    Damir avatar
    22 posts
    Registered:
    24 Nov 2008
    03 Nov 2009
    Link to this post
    Not sure what you mean,

    I have a Class which Inherits from the CompositeControl and an Overrides Sub CreateChildControls, where is the Base.Section Property?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    03 Nov 2009
    Link to this post
    Hi Damir,

    Try creating a ToolBox item for your control as shown below or type the name for the section manually in your web.config file

    /// <summary>
    /// This will determine what will be shown in the toolbox
    /// </summary>
    public class GCWrapperToolboxItem : System.Drawing.Design.ToolboxItem
    {
        /// <summary>
        /// Initializes the toolbox item with the proper type
        /// </summary>
        /// <remarks>
        /// The section under which the control is initially placed is determined by the
        /// [assembly: AssemblyCompany("Telerik")] attribute.
        /// Of course, it can later be changed to something else throuh web.config
        /// </remarks>
        public MyToolboxItem()
            : base(typeof(MyControl))
        {
            base.DisplayName = "some name";
            base.Description = "some description";
            base.Section = "your section";
            base.Company = " some data here";
        }
    }

    [ToolboxItem(typeof(MyToolboxItem))]
    public class MyControl: CompositeControl
    {
        
    }


    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
4 posts, 0 answered