More in this section

Forums / Developing with Sitefinity / Intra-Site module does not appear on the "Modules" page

Intra-Site module does not appear on the "Modules" page

4 posts, 0 answered
  1. Niki
    Niki avatar
    9 posts
    Registered:
    07 May 2007
    20 Jul 2007
    Link to this post
    Hi,

    I tried to make an intra site module without any functionality just to test if it appears in the admin panel. But without success...

    I just followed the instructions in the Developers Manual.

    Here is the code in the module class:

    using System;

    using System.Data;

    using System.Configuration;

    using System.Web;

    using System.Web.Security;

    using System.Web.UI;

    using System.Web.UI.WebControls;

    using System.Web.UI.WebControls.WebParts;

    using System.Web.UI.HtmlControls;

    using Telerik;

    using Telerik.Cms;

    /// <summary>

    /// Summary description for TestModule

    /// </summary>

    public class TestModule : Telerik.WebModule

    {

    #region Constants

    private string NAME = "Test Module";

    private string TITLE = "Just a Test Module";

    private string DESCRIPTION = "This is just a test module ;)";

    #endregion

    #region Fields

    private System.Collections.Generic.IList<Telerik.Web.IToolboxItem> toolboxItems;

    public override string Name

    {

    get

    {

    return this.NAME;

    }

    }

    public override string Title

    {

    get

    {

    return this.TITLE;

    }

    }

    public override string Description

    {

    get

    {

    return this.DESCRIPTION;

    }

    }

    public override System.Collections.Generic.IList<Telerik.Web.IToolboxItem> Controls

    {

    get

    {

    //throw new Exception("The method or operation is not implemented.");

    if (toolboxItems == null)

    {

    this.toolboxItems = new System.Collections.Generic.List<Telerik.Web.IToolboxItem>

    ( new Telerik.Web.ToolboxItem[]

    {

    new CmsToolboxItem("~/TestModule/PublicTest.ascx", "PublicTest", this.NAME, this.DESCRIPTION)

    }

    );

    }

    return this.toolboxItems;

    }

    }

    #endregion

    #region Methods

    public TestModule()

    {

    //

    // TODO: Add constructor logic here

    //

    }

    public override Control CreateControlPanel(TemplateControl parent)

    {

    return parent.LoadControl("~/TestModule/TestControlPanel.ascx");

    }

    public override IControlPanelCommand[] CreateToolBoxControls(TemplateControl parent)

    {

    return new IControlPanelCommand[] { (IControlPanelCommand)parent.LoadControl("~/TestModule/TestToolBox.ascx") };

    }

    #endregion

    }

  2. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    20 Jul 2007
    Link to this post
    Hi Niki,

    Please follow the steps below to add a module called Sample.Contacts to a Sitefinity project and display it in the Modules section.

    1. Modify your web.config file as follows:

    • Sample.Contacts is the name of the module. SectionHandler is the class inheriting the base class ConfigurationSection and contains the functionality for loading and accessing the contacts section information.
    <configSections>

                <sectionGroup name="telerik">

    <section name="contacts"         type="Sample.Contacts.Configuration.SectionHandler, Sample.Contacts" requirePermission="false"/>

                </sectionGroup>

    </configSections>

    • ContactsModule is the class, providing substantial information for your custom module.
    <framework>

      <modules>

    <add type=" Sample.Contacts.ContactsModule, Sample.Contacts"/>

      </modules>

    </framework>


    • Sample.Contacts.Data is the data project for the module and DefaultProvider is the class providing an implementation for the provider model.
    <telerik>

       <contacts defaultProvider="Sitefinity">

          <providers>

            <clear/>

            <add name="Sitefinity" securityProviderName="" type="Sample.Contacts.Data.DefaultProvider, Sample.Contacts.Data" connectionStringName="DefaultConnection" visible="true" />

          </providers>

       </contacts>

    </telerik>


    2. Copy  Sample.Contacts.Data.dll and Sample.Contacts.dll to the bin folder of your web site.

    Do let us know if you need any further assistance.

    Regards,
    Rebecca
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Niki
    Niki avatar
    9 posts
    Registered:
    07 May 2007
    20 Jul 2007
    Link to this post
    Hello,

    Thank you for your reply.

    But please note that I'm making an Intra - Site module that is not compiled to a .dll file.

    I just opened the SiteFinity website with Visual Studio and added the module class to the App_Code folder. Also I made a folder containing all .ascx files needed for the module. The code above is my module class.

    My ControlPanel class extends Telerik.IControlPanel and my ToolBox class extends Telerik.IControlPanelCommand as described in the Developers Documentation.

    When I compile the SiteFinity website everything goes fine but the module just does not appear.
  4. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    20 Jul 2007
    Link to this post
    Hi Niki,

    Sorry about that.

    We used your module class and it displayed just fine in the Modules section of  Sitefinity SP2. Can you please open a support ticket and send us your project and database so that we can have a closer look at it?

    Kind regards,
    Rebecca
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
4 posts, 0 answered