Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8894821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:36:19+00:00 2026-06-14T23:36:19+00:00

I am currently working on some SharePoint branding for the first time. I am

  • 0

I am currently working on some SharePoint branding for the first time. I am using SharePoint Foundation 2010. I was trying to attempt to remove the quick-launch section from the page for everybody that is not inside the “Administrator” group. Now, I tried writing a feature or web part to do this with the following c# code:

SPWeb web = SPContext.GetContext(this.Context).Web.ParentWeb;
web.AllowUnsafeUpdates = true;
web.QuickLaunchEnabled = false;
web.Update();

This did not remove the actual panel itself and move the main content over to the left. I decided to attempt this from a Jquery route. My code is copied below. However, when I tried this in the master-page, the page fully loads, and then the panel is removed. I would like this to occur before the page actually loads so the user does not see the page popup and then change. I am not 100% sure that JQuery is the way to go, please help me as I am struggling with this.

$(document).ready(function(){
     $().SPServices({
     operation: "GetGroupCollectionFromUser",
     userLoginName: $().SPServices.SPGetCurrentUser(),
     async: false,
     completefunc: function(xData, Status) {
        if($(xData.responseXML).find("Group[Name='Administrator']").length == 1)
        {}
        else{

         var quicklaunchpanel = document.getElementById('s4-leftpanel');  
    quicklaunchpanel.style.display="none";
    var maincontent = document.getElementById('MSO_ContentTable');
    maincontent.style.cssText = "margin-left:0px;";

        }
      }

});

Note: I also tried $(document).load() and $(‘#s4-leftpanel’).load() but neither of this caused any action what so ever.

TIA!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:36:20+00:00Added an answer on June 14, 2026 at 11:36 pm

    I was able to user the SPSecurityTrimmedControl to accomplish this:

    I originally set the display property to s4-leftpanel to “none” and then had this block of code after this panel:

    <Sharepoint:SPSecurityTrimmedControl runat="server" Permissions="FullMask">
            <script type="text/javascript">
                document.getElementById("s4-leftpanel").style.display = "block";
            </script>
            </Sharepoint:SPSecurityTrimmedControl>
    

    I also performaned the same for the margin of the MSO_ContentTable.I set it to 0px and then ran this code after that div:

            <Sharepoint:SPSecurityTrimmedControl runat="server" Permissions="FullMask">
            <script type="text/javascript">
                document.getElementById("MSO_ContentTable").style.marginLeft = "155px";
            </script>
            </Sharepoint:SPSecurityTrimmedControl>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on some coding for a hotel booking widget and am using
I'm currently working with some data using Javascript that is in the form of
I am currently working within the confines of sharepoint 2007 and have some code
I'm currently working with Sharepoint 2010 and Sharepoint API on creating a document library
I'm currently working on some search and replace operation that I'm trying to automate
I'm currently working on some project, using Apache Tapestry 5.3.6. I have issue using
I am currently working with some users that do not have the .NET Framework
I am currently working on some Ajax heavy code and I am wondering how
I'm currently working through some exercises in a c++ book, which uses text based
I am currently working on some simple custom allocators in c++ which generally works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.