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

Forums / General Discussions / Intra-Site Module and web.config

Intra-Site Module and web.config

4 posts, 0 answered
  1. John
    John avatar
    61 posts
    Registered:
    08 Jun 2012
    14 Dec 2009
    Link to this post
    Hello,

    I know that if, in web.config, I comment out the <module> entry for a module (say Blogs, for example), then the menu item for that module will not appear in the administration pages of Sitefinity. However, we have create several custom intra-site modules, and their <module> section entry in web.config does not seem to have any effect. I would like to be able to turn off our custom modules by commenting them out in web.config, or removing the entry completely, but the Modules still appear in the administration screens for me.

    Is this by design? Is Sitefinity "discovering" intra-site modules and automatically displaying them?

    Regards,
    John Gassman
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    14 Dec 2009
    Link to this post
    Hi John,

    If you have a class that inherits from SecuredModule or WebModule it is automatically detected by Sitefinity and added as a module.

    There are two options that I could come up right now

    1. Exclude the files from the project or remove the files from App_Code folder.

    2. Hide the tab from Sitefinity/Admin.master.cs

    protected void MainMenu_DataBound(object sender, EventArgs e)
        {
            //YOU CAN HIDE THE MODULE BASED ON A ROLE
            // NOTE THAT THE MODULE WILL BE ACCESSIBLE IF SOMEONE ACCESS IT DIRECTLY
            // THROUGH URL BAR
            RadTab moduleTab = MainMenu.FindTabByText("MyIntraSiteModule");
            if(moduleTab !=null)
              moduleTab.Visible = false;
            if (!String.IsNullOrEmpty(this.currentTab))
                SetCurrentTab(this.MainMenu.Tabs, this.currentTab);
          
        }


    All the best,
    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. John
    John avatar
    61 posts
    Registered:
    08 Jun 2012
    14 Dec 2009
    Link to this post
    Thank you Ivan.

    OK. It's not ideal, as a developer would be needed to turn these "on" or "off" by changing code or changing the project, as opposed to a change to the configuration file.

    We do inherit from SecuredModule so it looks like we'll need to exclude or remove all of our module files (at least those that depend on the main module class). Are there any plans in the future to allow the web.config to control which intra-site modules actually get loaded? I never noticed this before since we never had to turn off our custom modules before ;).

    Thanks again for your time and help!

    Regards,
    John Gassman
    Workstate Consulting
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    14 Dec 2009
    Link to this post
    Hello John,

    Changes to this implementation are made for Sitefinity 4.0. Since you inherit from Secured Module you can also restrict each role from seeing this module except the administrators of the website.

    All the best,
    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