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

Forums / Developing with Sitefinity / Is there an easy way to hide/show custom modules?

Is there an easy way to hide/show custom modules?

8 posts, 1 answered
  1. Anthony Smith
    Anthony Smith avatar
    34 posts
    Registered:
    08 Dec 2009
    06 Jan 2010
    Link to this post
    I've created a custom module but is there a way for me to hide/show this dynamically?

    Thanks
    Anthony
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    06 Jan 2010
    Link to this post
    Hi Anthony Smith,

    You can remove the RadTab Strip from the backend menu.

    protected void Page_Load(object sender, EventArgs e)
       {
           ....
                 ....
     
           System.Collections.Generic.IList<Telerik.Web.UI.RadTab> tabList = MainMenu.GetAllTabs();
           foreach (RadTab tab in tabList)
           {
     
               if (tab.Text == "ModuleName")
               {
                  tab.Visible = false;
               }
           }

    Note that the module will remain accessible by url, so you can create a HttpModule where you get the request and allow/deny view of the module.


    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.
    Answered
  3. Marijn Rispens
    Marijn Rispens avatar
    11 posts
    Registered:
    24 Sep 2009
    10 May 2010
    Link to this post
    Hi Ivan

    How can this be done in a Pluggable Module?

    Thank you.

    Best Regards,
    Marijn Rispens
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    10 May 2010
    Link to this post
    Hi Marijn Rispens,

    The type of the module does not matter. This hides the RadTab from the MainMenu that is bound in the backend master page - Admin.master.

    Sincerely yours,
    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. Marijn Rispens
    Marijn Rispens avatar
    11 posts
    Registered:
    24 Sep 2009
    10 May 2010
    Link to this post
    Hi Ivan

    When I try to get the RadTapStrip instance i get a error.

    protected virtual RadTabStrip MainMenu
    {
        get
        {
            return base.Container.GetControl<RadTabStrip>("MainMenu", true);
        }
    }

    Gives the error:

    A required control was not found in the template for "Gemeenteweb.SiteManager.NewsletterImporter.Resources.ControlTemplates.Backend.Newsletters.ascx". The control must be assignable form type "Telerik.Web.UI.RadTabStrip" and must have ID "MainMenu".


    Perhaps i'm doing something wrong?

    Thank You

    Best Regard,
    Marijn Rispnes
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    10 May 2010
    Link to this post
    Hi Marijn Rispens,

    The error says that you have a control of type RadTabStrip with ID ="MainMenu" which you set as required, but this control is not found under

     Gemeenteweb.SiteManager.NewsletterImporter.Resources.ControlTemplates.Backend.Newsletters.ascx".

    Could you elaborate some more about what you are trying to do? The above posts explains how to hide the module name from the main RadTabStrip control that shows the title of all modules.


    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.
  7. Marijn Rispens
    Marijn Rispens avatar
    11 posts
    Registered:
    24 Sep 2009
    10 May 2010
    Link to this post
    Hi Ivan

    I've build a Pluggable Module named "Gemeenteweb.SiteManager.NewsletterImporter".
    This module is only for support in other modules. There are some pages with user controls in this module, nothing fancy.

    Now this module is always visible in the menu, but we don't want that. Other modules contain links to this module when needed.

    So my question was, how can i make sure this module is available by URL, but not visible in the menu.
    Also the Quick Links menu on the Dashboard needs to hide this module.

    Hope this makes things clear and hope you can help.

    Thanks again.

    Best regards,
    Marijn Rispens
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    10 May 2010
    Link to this post
    Hello Marijn Rispens,

    You should use the code marked as answer in Sitefinity\Admin\Admin.master.cs. You need just find the tab for your module. You could access the Dash to links from Sitefinity\Admin\Default.aspx and hide them.

    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.
Register for webinar
8 posts, 1 answered