# Remove ribbon entirely on certain page?

Can this be done with SharePoint Online?

Failing that, for an entire site?

Thanks.

-

Create a JS file (HideScript.js) and paste the following code in it, which hides the ribbon for a certain page. Upload the JS file to some document library for e.g. "SiteAssets"

function HideRibbon() {

$("#s4-ribbonrow").hide(); var newHeight =$(document).height();

if ($.browser.msie) {newHeight = newHeight - 3; }$("#s4-workspace").height(newHeight);

}



Refer the JS in your page layout(for which you would like to hide ribbon) like this:

<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server">

<asp:literal ID="Literal6" runat="server" Text="&lt;script src='" />
<asp:literal ID="Literal7" runat="server" Text="<% $SPUrl:~site/SiteAssets/jquery-1.8.0.min.js %>" /> <asp:literal ID="Literal8" runat="server" Text="' type='text/javascript' &gt;&lt;/script&gt;" /> <asp:literal ID="Literal1" runat="server" Text="&lt;script src='" /> <asp:literal ID="Literal2" runat="server" Text="<%$SPUrl:~site/SiteAssets/HideScript.js %>" />
<asp:literal ID="Literal3" runat="server" Text="' type='text/javascript' &gt;&lt;/script&gt;" />

</asp:ContentPlaceHolder>


Update: with CSS it's just

#s4-ribbonrow

{

display: none;

}


Happy SharePointing!

-
Nice one bro, thanks for sharing :) ! –  Muhammad Raja Jan 7 '13 at 23:09
Does this definitely work in SharePoint Online? When I edit the page in question with SharePoint Designer, I can see the start and end tags for the ContentPlaceHolder, but no literals. And I am unable to chnage the html at all. Thanks. –  finisterre Jan 9 '13 at 15:10
Aha, so ADVANCED MODE allows me to edit. So I've added those 3 lines, and saved, but no effect. –  finisterre Jan 9 '13 at 15:26
have your uploaded/loaded jquery-1.8.0.min.js file before running script? See my updated scripts –  Falak Mahmood Jan 9 '13 at 17:40
Falak. That works. But it turns off the top (smaller) blue bar and leaves the bottom (larger) grey bar. I was hoping to leave to top blue bar with 'Site Actions' etc. and turn off the big grey bar (where the edit icons etc. live). Do you know if this is possible? Thanks. –  finisterre Jan 9 '13 at 18:21

This is possible and there are many tuts on this, if you dont want to produce a custom solution than i highly recommend using this tool,

With this solution you can on each site define if the ribbon is display or not for :

Everyone

Anonymous user for one or many

specific SharePoint groups

http://spribbonvisibility.codeplex.com/

or

set s4-ribbonrow to none (could use feature to performe this ;))

http://blogs.msdn.com/b/zwsong/archive/2010/04/29/how-to-hide-ribbon-from-users-without-edit-page-privilege.aspx

Happy coding ;)

-

As far as I know Ribbon is part of SharePoint Master Page, hiding it on a certain page isn't possible rather its SharePoint 2010 or SharePoint online.

Now there might be some hack available but I am not aware of one.

Hope it helps.

-
I marked this down due to answer is missleading! –  ali Sharepoint Jan 8 '13 at 0:12