More in this section

Forums / Developing with Sitefinity / Hiding toolbox controls

Hiding toolbox controls

5 posts, 0 answered
  1. Andrei
    Andrei avatar
    553 posts
    Registered:
    27 Nov 2008
    24 Jun 2009
    Link to this post
    Hi,

    How do I hide controls from teh toolbox? I want to hide things like the 'RSS Feeds', 'Search', and so on.

    Thanks

    Andrei
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    24 Jun 2009
    Link to this post
    Hello Andrei,

    Thank you for contacting us.

    Please take a look at the following the blog post HACK: How to hide controls from toolbox section in Sitefinity 3.6 in the Sitefinity Blogs.

    The example code that Ivan is giving is for hiding the "Most Popular" section of your tool box. In order to hide RSS and Search replace the code:
    if (panel != null && (panel.Text == "Most Popular" || panel.Text == "Custom"
                        && User.IsInRole("administrators")) 
                    { 
                        panel.Visible = false
                    } 

    with the text for the sections you want yo hide:
    if (panel != null && (panel.Text == "RSS Feeds" || panel.Text == "Search"
                        && User.IsInRole("administrators")) 
                    { 
                        panel.Visible = false
                    } 

    You can see that he is also checking for the user role and hiding these sections for users in administrators role, you can change it for any role you want or remove it.

    I would also recommend taking a look at Let's hide Upload Controls section from Sitefinity 3.6 toolbox blog post.

    Please feel free to contact us if you have more questions.

    Best Regards
    Rado
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Andrei
    Andrei avatar
    553 posts
    Registered:
    27 Nov 2008
    26 Jun 2009
    Link to this post
    Ivan,

    Where is this App_Code folder?

    I can not find it. I copied teh code into a .cs file and looking to driop it into the App_Code folder but not sure where it is. Can't find it in the filing structure.

    Thanks

    Andrei
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    26 Jun 2009
    Link to this post
    Hello Andrei,

    The directory should be in the web site root, just like the App_data directory. If you do not have it, you can create it (keep the name App_Code). For full reference on the special Asp.Net folder, please take a look at Shared Code Folders in ASP.NET Web Sites

    Kind regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Andrei
    Andrei avatar
    553 posts
    Registered:
    27 Nov 2008
    26 Jun 2009
    Link to this post
    thank you

    your suggestion works now.

    Thanks

    Andrei
Register for webinar
5 posts, 0 answered