Saturday 10 March 2012

How to hide or set permission to show the customized Yellow status bar

Last week i have customized the wiki pages using with SharePoint Designer 2010.

One of the side effect i have observed one yellow status bar, it shows up on the customized pages in the browser, "The current page has been customized from its template. Revert to Template". If end users clicks on the "Revert to Template", it would reset the page to the site definition.


After much research about this i noticed one DIV tag in masterpage. ie  
<div id="s4-statusbarcontainer">
    <div id="pageStatusBar" class="s4-status-s1">
    </div>
</div>

set the DIV visibility status as 'none' so the div will not visible. 
<div id="s4-statusbarcontainer" style="display:none">
    <div id="pageStatusBar" class="s4-status-s1">
    </div>
</div>

with above process status bar will not visible to administrators, Contributors,Viewers, or anonymous users. So that even administrators also can not see the status bar and its message.
If you want to show such alerts only administrators and contributors, not to viewers,anonymous users. Then you wiil need to play around with permission attribute.

Just put the above DIV tag in SecurityTrimmedControl with permission status "Manage web"
<SharePoint:SPSecurityTrimmedControl id="SPSecurityTrimmedControl" runat="server" Permissions="ManageWeb">
<div id="s4-statusbarcontainer" style="display:none">

    <div id="pageStatusBar" class="s4-status-s1">
    </div>
</div>
</SharePoint:SPSecurityTrimmedControl>
with above code who can manage the web they can only see the status bar. Anonymous users can not see the status bar just like below screenshot


No comments:

Post a Comment