Sunday, October 10, 2010

Move ribbon row above the menu and below the logo

Ribbon - to like or not to like?

During my meetings with the clients, I've been asked numerous times the same question "Can you move the ribbon above the menu?" Personally I like it more this way as the SharePoint site looks like normal web sites that we see all the time: header that contains logo, slogan and some more stuff and then the top menu.

Here is how standard Team site looks like, especially the ribbon that is on the very top of the page:

Before customizing the master page, let's enable the publishing infrastructure - this way every change of the master page will require approval before actually appears on the site. This approach also minimize the risk of breaking the site by saving broken master page. Let's show it in steps:

Step 1 - First of all let's activate the "Server Publishing Infrastructure" for Site Collections

   1. From the site, go to Site Actions and select Site Settings
   2. Under Site Collection Administration and chose Site Collection Features
   3. Activate the SharePoint Server Publishing Infrastructure

Step 2 - next we need to  activate "Server Publishing" for the Site

   1. From the site, go to Site Actions and select Site Settings
   2. Under Site Actions chose Manage Site Features
   3. Activate the SharePoint Server Publishing

Step 3 - edit the master page in SharePoint Designer

  1. From the site, go to Site Actions and select "Edit in SharePoint Designer"
  2. After SharePoint Designer is loaded, open the "Master Pages" in the left menu

    Next 3 steps will create new master page (I always recommend new master page rather then customizing the default one).
  3. From the Top Ribbon click the button "Blank Master Page" and enter some name
  4. Right click on the new master page and select "Edit File in Advanced Mode"
  5. Copy and Paste the HTML from the default v4.master
By default the HTML for Ribbon is on the top of the master page after the start body tag:

 Now let's move the ribbon. actually we are going to move the row that contains  the Logo of the site and the short description: it will be a bit easier as it contains less HTML then the ribbon.

  1. So find the following code in the source: <div class="s4-title s4-lp"> and simply right click and select the option "Select Tag":
  2. Cut the whole HTML that is selected
  3. Paste the HTML above the ribbon row which is
    <div id="s4-ribbonrow" class="s4-pr s4-ribbonrowhidetitle">Also shown below where to paste the HTML: 
After doing this simple step we managed to get this:



 Here are few more examples how this small change affect the whole look&feel of the site:

15 comments:

Anonymous said...

Thanks, this worked perfectly.

Has anyone else had the following issue after doing the above? When i opena "new Item" form i.e. the form that pops up when you click on the "+add document", "+add" (in calendar)etc, the form window isn't big enough vertically? You either get a scroll bar or no scroll bar where you have to tab through the form to get to the bottom? Any help would be great, thanks.

Jeff said...

I have the same issue as the other user who needs to tab through to get to the bottom when needing to select OK on any forms. Any idea why this ribbon change affects this?

SharePoint Masters said...

Yes, there is an updated CSS file. One of the classes needs an update. Can you post your CSS class here and I will be able to tell you what needs to be updated

Kyle said...

Hi there,

Thanks so much for the guide. I am having the same issue as the above posters.

I apologize as I'm only beginning to learn SharePoint Designer & CSS, so I'm unsure as to what class needs to be updated.

I have made no modifications to the Master Sheets with the exception of what you have shown above.

I hope this makes it easier to identify what the issue is since I'm working in a vanilla SharePoint 2010 environment.

Thanks so much for your help!

Oris Carballosa said...

I know this is a bit old but maybe you can help, is there a way to make the menu independent from the ribbon? For example, when the edit ribbon appears, it replaces the header and menu until you get out of edit more.

Anonymous said...

Where can I find my class and I will upload it. I am having the same issue as the responses above concerning the "new document" etc being vertically challenged. Any help is appreciated. Thanks!

Anonymous said...

Same problem as the guys above. I'm guessing no one did upload or find the class?

Thanks

Anonymous said...

the required CSS classes are in the other article:

http://spmasters.blogspot.de/search/label/SharePoint%202010%20branding

Anonymous said...

Thanks for directing me to that page. However, I still cannot find the part that is affecting the upload page.

Please see here for details, I've added the issue with screen shots here: https://sites.google.com/site/spdevtips/home/design/problemaftermovingribbon

Any help will be appreciated.

SharePoint Masters said...

oh, I finally understood what's your problem.


All you need to do is add to the ribbon one special CSS class called "s4-notdlg"

so:
1. locate the div < div class="s4-title s4-lp">

2. add "s4-notdlg"

<div class="s4-title s4-lp s4-notdlg">

and try again

Anonymous said...

Adding s4-notdlg worked perfectly.

I would very much like to understand what adding that actually did.

Thanks for offering your expertise.

SharePoint Masters said...

Actually "s4-notdlg" is one of the SharePoint "system" CSS classes. Based on it SharePoint automatically understand that should not display the content marked with "s4-notdlg" in the dialog boxes.

If you note every dialog has one parameter in the URL "IsDlg=1". From this param SharePoint understand this is dialog box, and from the CSS classes "s4-notdlg" understand what content should display/not display

So..... at the end this is just a build-in mechanism to display content

Ajuna Newton Brian said...

You are the best. Thank you so much. I do appreciate

Anonymous said...

RibbonBar for moving item with drag and drop

Anonymous said...

Does this work in Sharepoint Online.