0

Hiding the ‘Create Site’ option in the Site Actions menu

Within SharePoint you have something called custom actions. You can use custom actions to create custom menu items within SharePoint. Besides custom actions you also have hide custom actions to hide custom actions. With the hide custom actions you can only hide custom actions that have been created with a CustomAction schema file.

The ‘Create Site’ menu options and also the ‘Create Page’ option are not created with a custom actions but on a different way. To hide these custom actions you can alter a file that resides in the masterpages gallery within a site collection.

In the masterpages gallery there is a folder called ‘Editing Menu’ in this folder there are four files you can use to alter certain menu options.

When you would like to hide the ‘Create Site’ action in the site actions menu you have to alter the CustomSiteAction.xml file by adding several nodes. Below there is an example of a CustomSiteAction.xml file that hides the ‘Create Site’ action:

<xml version="1.0" encoding="utf-8" ?>
<Console>
    <references>
<reference TagPrefix="cms" assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"   namespace="Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions" />
    </references>
    <structure>
     <ConsoleNode ConfigMenu="Delete" ChangedNodeID="wsaCreateSite" />
    </structure>
</Console>

The reference is to a SharePoint assembly that creates the custom actions. The ‘ConsoleNode’ stated what should happen with a certain menu action in the above example it is ‘ChangeNodeID’ which is ‘wsaCreateSite’ (This id can be found be looking in the source of the page). If you would also like to hide the ‘Create Page’ action you add the following line to the CustomSiteAction file:

<consolenode changednodeid="wsaCreatePage" configmenu="Delete" />

These changes can also be done with a feature and a feature receiver if you guys would like to have a example how to accomplish this let me now and also if you would like to see some examples for the other files.

Related Posts

SharePoint Rest API Handler SharePoint contains a lot of Rest API’s that can be used for many scenario’s. You could use them for example in desktop and windows phone applications...
User automatically removed from SharePoint Group During my current project we received an access request from a user. We did what we normally do, we checked the request and added the user in the appr...
Warm Up Form Based Web Application Normal warm up scripts for SharePoint open a site object or web object and make a request to that specific site. When you use form based authenticatio...
Load modules by default when opening PowerShell At the moment we are working a lot with PowerShell in combination with SharePoint. Over time we created a lot of usable functions that were not availi...
PowerShell Scripts During my current project we are using a lot of PowerShell scripts to administrate the environment and make development easier for us. In this post...
TFS and SharePoint Builds including Automatic deployments – Part 1 Part 1 of this series will instruct how to configure your build server for building SharePoint projects. In Part 2 we will discuss the automatic deplo...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.