In this recipe, we will create a custom master page that is branded for a public-facing SharePoint site. In addition, this master page will only show the page editing controls to those with contribute access to the SharePoint site.
To see the results of this recipe, you will need to be able to access the SharePoint site both anonymously and logged in.
Follow these steps to create a master page with editing controls only available to editors:
PublicMasterPage.css
stylesheet file to the resources
folder located at_catalogs/masterpage/resources
.seattle.master
(for our example, we have renamed it Seattle_PublicWebsite.master
).Seattle_PublicWebsite.master
master page.Seattle_PublicWebsite.master
master page.PublicMasterPage.css
stylesheet file.<SharePoint:CssRegistration ID="customCssRegistration" Name="<% $SPUrl:~Site/_catalogs/masterpage/resources/PublicMasterPage.css %>" runat="server"></SharePoint:CssRegistration>
#s4-workspace { background: #FFFFFF; margin: 50px 100px 50px 100px; } body { background: #999999; } #s4-ribbonrow, #suiteBar { background: #FFFFFF; }
suiteBar
ID as follows:suiteBar
element, add the beginning tag for a <SharePoint:SPSecurityTrimmedControl>
control with the permissions set to EditListItems
as shown in the following line of code:<SharePoint:SPSecurityTrimmedControl ID="customSecurityTrimmedControl" PermissionContext="CurrentSite" PermissionsString="EditListItems" runat="server">
s4-workspace
ID.s4-workspace
element, add the following end tag for the <SharePoint:SPSecurityTrimmedControl>
control:</SharePoint:SPSecurityTrimmedControl>
In this recipe, we used CSS to provide padding around the content of the page and used an SPSecurityTrimmedControl
control to hide the page editing controls to users who do not have access to edit the pages.
3.145.179.59