Hiding the "New Site" option in the Site Actions menu – SharePoint 2010
A long time ago I wrote an article about hiding the create site action within the site actions menu for SharePoint 2007. Within SharePoint 2010 you hide the custom actions the same way. Only finding the Id’s is a little bit different. In the preceding article I stated that you can find the id’s within the source of the page. This is still true but some of them can only be found within the Master Page. The table below display’s all custom actions with the Id’s of the actions.
Custom action | ID |
---|---|
Edit Page | MenuItem_EditPage |
Sync to SharePoint Workspace | MenuItem_TakeOffline |
New Page | MenuItem_CreatePage |
New DocumentLibrary | MenuItem_CreateDocLib |
New Site | MenuItem_CreateSite |
More Options | MenuItem_Create |
View All Site Content | MenuItem_ViewAllSiteContents |
Edit in SharePoint Designer | MenuItem_EditSite |
Site Permissions | MenuItem_SitePermissions |
Site Settings | MenuItem_Settings |
Thanks for these Id. This helps a lot.
I am in search of one more Id for the “Manage Content and Structure” option that shows up under Site Actions on the parent site. I need to hide this option for certain users.
If you cuold help out with this, it would be greatly appreciated.
Thanks,
Ken
Ken, This can’t be seen in the master page. There are two ways to achieve this:
1. Create a delegate control (use AdditionalPageHead) with a panel that simply contains jQuery/javascript to traverse the dom and find tag with span text ‘Manage Content And Structure’
–The code behind can do the necessary check on permission and show/hide the panel.
See: http://pastie.org/3527969
2. (Better)
Create custom action with a control class and use GetMenuItem(“wsaManageSite”) then apply security.
Hi Ken,
I would like to hide ‘New site’ option through a sharepoint feature. I checked your article https://msftplayground.com/2009/12/hiding-the-create-site-option-in-the-site-actions-menu/. It shows how to hide the option by directly modifying the xml.
Can you please guide me on how to hide this option through a sharepoint feature?
Thanks,
Mayuri
Hi Mayuri,
You can take a look at the following links:
https://msftplayground.com/2009/12/hiding-the-create-site-option-in-the-site-actions-menu/
https://msdn.microsoft.com/en-us/library/ms414790.aspx