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.
Chze Yin said…
I wrap Welcome component and the search into one table and it works find in my design, both in IE7 and IE8... :)
Elio 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.
Jessica 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....
Paul 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
balan 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;
}
Michal Mistina 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

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.
<Style>
body #s4-leftpanel
{
display: none;
}
.s4-ca
{
margin-left: 0px;
}
</style>
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.

Small Calendar for SharePoint 2010 & 2013

First off I would like to apologize for the lack of posts. I have been really busy with my new role as the UX Design lead within Slalom Consulting Boston. I will share more about that in another post. In a previous post Create Really Small Calendar I showcased how to do this for SharePoint 2007. However the 2010 and 2013 calendar views have changed and therefore we cannot use the same method or CSS as 2007.SharePoint 2010 Small Calendar:
SharePoint 2013 Small Calendar:
See video below for a video walk through on how to create a small calendar for SharePoint 2010 and & SharePoint 2013 with just CSS.Per the video above here is the code that I referenced:2010 CSS link reference in Master Page:
<SharePoint:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/smallcalendar.css %>" After="corev4.css" runat="server"/>2010 CSS:
/**** Small Calendar ***/
.ms-acal-item{height: 10px !important;}
.ms-acal-sdiv,
.ms-acal-mdiv,
.ms-…

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…