Skip to main content

Issues with moving search into top ribbon bar

I was recently on a project where there was a requirement to have many items in the main navigation. There was not an option to consolidate these into smaller groups. The idea was to move the search box up into the top ribbon bar.


This would allow for more horizontal space for the navigation items. However in my attempt to move the search I found a little gotcha. I selected the search control in SharePoint Designer and moved it right above the welcome navigation control code.


Wrapped the control in a div tag and temporarily added an inline style of float left.

<div style="float: left;">
   <asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server">
      <SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" Version="4"/>


I saved the master page and then checked out what it looked like. The search was moved up correctly but it was not until I used IE8 dev toolbar to check for compatibility in IE7.


As you can see below in IE7 the search, and welcome link/drop down is no where to be seen and the ribbon tabs got all squished.


After doing some testing in IE7 mode an inline style gets applied to the ms-cui-TabRowRight with “Display: none”


I am not 100% why this is, but if I try to put the search anywhere else in the ribbon it just does not show… So I guess this is more of a warning to the designers out there. If you are thinking about putting the search in the top ribbon bar in your design comps know that there might be some issues with browser compatibility.

So what I ended up doing is moving the search to the left of the Social Notification tags. Wrapped it in a <td> tag and called it a day. The client was happy with the results since they were still able to have their navigation items and the search moved to a different location.



Please comment on this post if you have seen this issue before or have found a fix. Thanks!


marcel said…
I have the same problem when i customize the ribbon. I've been looking around to see what the problem is, i see when you use the default ribbon, this div class 'ms-cui-tts' is used, but when you customize it, it uses this div class 'ms-cui-tts-scale-2'. In 'ms-cui-tts-scale-2' css you'll see that the width is 0.

Do you see the same?
Anonymous said…
Thanks for this post - I needed to move the Search box and had trouble doing it in the Design mode. I have no code knowledge but copied your code and managed to move the search to sit beside the social buttons.
happy-snail said…
I wrap Welcome component and the search into one table and it works find in my design, both in IE7 and IE8... :)
Elio Struyf said…
Hey, I did this 2 months ago for a client. you need to specify a with to the searchbox. I have made a post on my blog so that you can see how I solved it.
Erik Swenson said…
Thanks Elio,

Next time I need to move the search I will try out your approach.
Unknown said…
FYI: Elio's solution works brilliantly. Just deployed it to a major client's intranet. Stood up to QA testing. No issues so far....
Unknown said…
Elio, thanks a lot for the solution. I had been working on this, and I was able to get the search bar and help button in the correct locations, but the search bar would not allow any editing.

I had edited the master page in Visual Studio, and the only way I could get it to show properly was to actually add the controls to the RibbonContainer-TabRowLeft portion, and use absolute positioning, etc. to show it on the right.

Now it's working great, so thanks!

Unknown said…
Awesome. Simple but really a great stuff.
Locksmiths said…
Thank you so much for this. I also had a problem with too many links in the navigation bar and had to move the search feature. Now it's the matter of styling the search icon and background for it.
king said…
How to apply roundede corners to search box in sharepoint 2010 search box?What has to changed in .css?
lj said…
This one customisation of the styling both changed the style to ms-cui-tts-scale-2 as well as resulted in the hiding of the right tab area as well....
#s4-ribbonrow *
lj said…
addition to last post... use this instead to remove the border of the tool bar
Unknown said…
I tried to prepare the new div area to the left side of the the WelcomeMenu button where I would insert SiteActions button. Logically I would think I would place WelcomeMenu to the right (float:right) and new div to the left (float:left). Shifting WelcomeMenu can be done by adjusting s4-trc-container-menu class where the default declaration is float:left. If I changed it to the float:right I got the same issue as is described in this article. No fix.

Popular posts from this blog

SharePoint 2010 Base CSS Classes

This will be the first of many SharePoint 2010 posts. I will be focusing on a few of the main CSS classes used for SharePoint 2010 Public Beta. As the product becomes more final there might be some changes to the class names but I will be sure to create a new post if that happens. This will be quite a lengthy but it should be helpful. The default CSS given below are just highlights of the full CSS attributes for that class.I will be using a basic team site as my base for the screenshots. Here is a basic structure of the main areas that I will cover.Ribbon RowTable Row Left Site Actions Navigate Up Edit Tab List Browse Page Table Row Right Give Feedback Welcome Menu WorkspaceBody Container Title Row Title Title Logo Title Text / BreadcrumbPage DescriptionSocial Data SeparatorI like It Tags/Notes Top Header 2/Top Links li Static-Selected li Static SearchHelpStatus Bar Container Main A…

SharePoint 2010 Content Query for Blog Posts

I hope this post will help many of you feel comfortable with using the Content Query Web Part.In this post I will walk you through the process of creating a content query web part and configuring it to show custom field types. I will also give details on how to use XSLT to stylize and format the data being pulled. I will be using the following scenario as an example. Say that you had a site collection with a top level publishing site. This publishing site would display a the most recent blog posts from all blog sites within its own site collection. To solve this problem we will use a Content Query Web Part and a customized ItemStyle.xsl using XSLT.Please note that the “SharePoint Server Publishing Infrastructure” needs to be enabled at the site collection to display the content query web part.Step 1: Add a Content Query Web Part to PageNavigate to the site that you want the blog posts to show up and click on edit page. Under Editing Tools in the Ribbon, Click on insert > Web PartUn…

How To: Hide Left Side Navigation on Home Page

I was recently asked: "How can I hide the side nav bar on the main homepage layout ?? I want to be able to use the side NAV with in the team site etc etc, but I don't want it on the front page.. " There are a couple of ways to do this in SharePoint 2010. If you are using a non-publishing site you can add a Content Editor Web Part to the page and add the following to the HTML Source.
body #s4-leftpanel
display: none;
margin-left: 0px;
Basically the CSS above hides the left navigation Div, and then sets the content area to not have a left margin. Once you are done, simply modify the web part and hide it on the page. If you are using a publishing site for your homepage simply add the same styles specified above to a custom page layout. That way if you have a need for other pages that do not need the left side navigation you can re-use the page layout.