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.

image

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.

image

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"/>
   </asp:ContentPlaceHolder>
</div>

image

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.

image

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.

image

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

image

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.

image

image

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

Comments

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.

http://estruyf.be/blog/moving-the-searchbox-into-the-top-ribbon/
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!

Paul
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,
#s4-ribbonrow *
{
border-width:0px;
}
lj said…
addition to last post... use this instead to remove the border of the tool bar
.ms-cui-topBar2{
border-width:0px;
}
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 Row Table Row Left Site Actions Navigate Up Edit Tab List Browse Page Table Row Right Give Feedback Welcome Menu Workspace Body Container Title Row Title ...

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 Page Navigate 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 ...

SharePoint 2013 Responsive Table Columns

I have been wanting to write this one for a while now. It is really amazing how UX is really finding is way into everything that we use and interact with. From Custom applications both mobile and on a desktop to document management or large data visualizations. There is always room for better usability and new concepts. SharePoint lists and library functionality really has not changed much for the past 10 years... I remember back in 2003 when I saw the same table/grid based views of documents and list items that exists in SharePoint 2013. But now we can look at them in a whole new way! In this video blog you will see how to create a responsive CSS table so that when the browser size is reduced it will hide specific columns. However hiding data is not always the right thing to do. What if a user needed those columns to filter on or to use for comparison to another document? Well that is where the custom jQuery Column chooser comes in. It allows you to see what columns are displ...