You guys ever get those crazy requests too from your boss? Things that really don’t matter at all and they only want to do it, because they thought of the idea. Well I get those all the time. This time it was to hide the Site Actions for our new SharePoint 2007 setup. I mean really, who cares if users can see the link/button, they can’t do anything and they’re used to seeing it from SP 2003 so it’s not like they’ll get confused about it. But anyway, the good team player I am I went in and figured out how to do it for us.
I’m not sure if this will work for everyone. I also did this like 6 months ago after searching for a few hours and not really finding anything. Probably because no one else care. But anyway, You should just have to wrap/replace your Site Actions code in your Template and it should hide the button from those who don’t have access to use it. I hope this helps out some of you out there that have the same request.
Code:
<style type="text/css">
#LeftNavigationAreaCell {
display:none;
}
</style>
<SharePoint:SPSecurityTrimmedControl PermissionsString="AddAndCustomizePages, ManageLists" runat="server">
<style type="text/css">
#LeftNavigationAreaCell {
display:block;
}
</style>
<table height=100% class="ms-siteaction" cellpadding=0 cellspacing=0>
<tr>
<td class="ms-siteactionsmenu" id="siteactiontd">
<SharePoint:SiteActions runat="server" id="SiteActionsMenuMain"
PrefixHtml="<div><div>"
SuffixHtml="</div></div>"
MenuNotVisibleHtml="&nbsp;"><CustomTemplate>
<SharePoint:FeatureMenuTemplate runat="server" FeatureScope="Site" Location="Microsoft.SharePoint.StandardMenu" GroupId="SiteActions" UseShortId="true">
<SharePoint:MenuItemTemplate runat="server" id="MenuItem_Create" Text="<%$Resources:wss,viewlsts_pagetitle_create%>" Description="<%$Resources:wss,siteactions_createdescription%>" ImageUrl="/_layouts/images/Actionscreate.gif" MenuGroupId="100" Sequence="100" UseShortId="true" ClientOnClickNavigateUrl="~site/_layouts/create.aspx" PermissionsString="ManageLists, ManageSubwebs" PermissionMode="Any" />
<SharePoint:MenuItemTemplate runat="server" id="MenuItem_EditPage" Text="<%$Resources:wss,siteactions_editpage%>" Description="<%$Resources:wss,siteactions_editpagedescription%>" ImageUrl="/_layouts/images/ActionsEditPage.gif" MenuGroupId="100" Sequence="200" ClientOnClickNavigateUrl="javascript:MSOLayout_ChangeLayoutMode(false);" />
<SharePoint:MenuItemTemplate runat="server" id="MenuItem_Settings" Text="<%$Resources:wss,settings_pagetitle%>" Description="<%$Resources:wss,siteactions_sitesettingsdescription%>" ImageUrl="/_layouts/images/ActionsSettings.gif" MenuGroupId="100" Sequence="300" UseShortId="true" ClientOnClickNavigateUrl="~site/_layouts/settings.aspx" PermissionsString="EnumeratePermissions,ManageWeb,ManageSubwebs,AddAndCustomizePages,ApplyThemeAndBorder,ManageAlerts,ManageLists,ViewUsageData" PermissionMode="Any" />
</SharePoint:FeatureMenuTemplate>
</CustomTemplate></SharePoint:SiteActions>
</td>
</tr>
</table>
</SharePoint:SPSecurityTrimmedControl>
By: FreedomChicken