Search Center and the Lost Search Box

October 14 2010 23 comments

You Have customized your SharePoint site and made a nice design based on the v4.master or even starter.master and applied your custom master as a system master as well. Everything’s cool until your “search-person” configures the search and tells you that something’s wrong with the Search Center. There is no search box at all.

Search Box Ex has gone awol

Search Box Ex has gone awol

Let’s investigate!

Our journey starts from the grassroot level where we travel to the 14-hive and inspect the basic search center’s site definition. We’ll open up the onet.xml found in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\SiteTemplates\SRCHCENTERLITE\XML\ and look for an instance of the SearchBoxEx webpart in the Default module.

 <Module Name="Default" Url="" Path="">
      <File Url="default.aspx">
                <Property Name="Title" Value="$Resources:Microsoft.Office.Server.Search,SearchCenterPageTitle;" />
                <AllUsersWebPart WebPartZoneID="TopZone" WebPartOrder="1">
                    <![CDATA[
                   <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
                       <Assembly>Microsoft.Office.Server.Search, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
                       <TypeName>Microsoft.SharePoint.Portal.WebControls.SearchBoxEx</TypeName>
                       <Title>$Resources:Microsoft.Office.Server.Search,SearchBoxWP_Title;</Title>
                       <Description>$Resources:Microsoft.Office.Server.Search,SearchBoxWP_Desc;</Description>
                       <FrameType>None</FrameType>
                       <AllowMinimize>true</AllowMinimize>
                       <AllowRemove>true</AllowRemove>
                       <IsVisible>true</IsVisible>
                       <Width>800px</Width>
...
...
...

From here we can see that the SearchBoxEx web part resides in a web part zone with an ID of TopZone. Now that we know which web part zone contains the missing search box, we’re going to look it up on the default page layout in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\SiteTemplates\SRCHCENTERLITE\default.aspx

<asp:Content ContentPlaceHolderID="PlaceHolderTitleBreadcrumb"  runat="server">
<SharePoint:UIVersionedContent UIVersion="3" runat="server">
<ContentTemplate>
<A name="mainContent"></A>
<div style="height:100%; width:100%;padding-left: 18px; padding-top: 50px; padding-bottom: 10px;">
<center>
<div style="width: 390px"  >
</ContentTemplate>
</SharePoint:UIVersionedContent>
<SharePoint:UIVersionedContent UIVersion="4" runat="server">
<ContentTemplate>
<div class="srch-sb-results7">
<div class="srch-sb-results6">
</ContentTemplate>
</SharePoint:UIVersionedContent>
<WebPartPages:WebPartZone runat="server" AllowPersonalization="false" Title="<%$Resources:Microsoft.Office.Server.Search,LayoutPageZone_TopZone

%>"
ID="TopZone" Orientation="Vertical" QuickAdd-GroupNames="Search" QuickAdd-ShowListsAndLibraries="false" />
</div>
<SharePoint:UIVersionedContent UIVersion="3" runat="server">
<ContentTemplate>
</center>
</ContentTemplate>
</SharePoint:UIVersionedContent>
</div>
</asp:Content>

Carefully wrapped inside some legendary HTML lies the TopZone. As you can see from the code snippet above, the TopZone is inside a content control with a very nicely thought ContentPlaceholderID PlaceHolderTitleBreadcrumb. As we know, content placholders reside on the master page and that is the file we are going to look for next. Let’s open up v4.master (I’ll use the one on C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\GLOBAL as I’m a bit lazy but don’t make a habit out of this).

If you do a search for PlaceHolderTitleBreadcrumb on the v4.master you’ll come up with something like this:

<SharePoint:PopoutMenu
runat="server"
ID="GlobalBreadCrumbNavPopout"
IconUrl="/_layouts/images/fgimg.png"
IconAlt="<%$Resources:wss,master_breadcrumbIconAlt%>"
IconOffsetX=0
IconOffsetY=112
IconWidth=16
IconHeight=16
AnchorCss="s4-breadcrumb-anchor"
AnchorOpenCss="s4-breadcrumb-anchor-open"
MenuCss="s4-breadcrumb-menu">
<div class="s4-breadcrumb-top">
    <asp:Label runat="server" CssClass="s4-breadcrumb-header" Text="<%$Resources:wss,master_breadcrumbHeader%>" />
</div>
<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server">
    <SharePoint:ListSiteMapPath
        runat="server"
        SiteMapProviders="SPSiteMapProvider,SPContentMapProvider"
        RenderCurrentNodeAsLink="false"
        PathSeparator=""
        CssClass="s4-breadcrumb"
        NodeStyle-CssClass="s4-breadcrumbNode"
        CurrentNodeStyle-CssClass="s4-breadcrumbCurrentNode"
        RootNodeStyle-CssClass="s4-breadcrumbRootNode"
        NodeImageOffsetX=0
        NodeImageOffsetY=353
        NodeImageWidth=16
        NodeImageHeight=16
        NodeImageUrl="/_layouts/images/fgimg.png"
        RTLNodeImageOffsetX=0
        RTLNodeImageOffsetY=376
        RTLNodeImageWidth=16
        RTLNodeImageHeight=16
        RTLNodeImageUrl="/_layouts/images/fgimg.png"
        HideInteriorRootNodes="true"
        SkipLinkText="" />
    </asp:ContentPlaceHolder>
</SharePoint:PopoutMenu>

Wow, the actual content placeholder is inside a breadcrumb popoutmenu. This could be a legacy from MOSS 2007 where the breadcrumb placeholder was close to the main content placeholder in the DOM, but we are not going to support it anymore. Let’s edit here. First we will take the ListSiteMapPath control out of the content placeholder and let the content placeholder tag close itself:

<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server" />
<SharePoint:ListSiteMapPath
    runat="server"
    SiteMapProviders="SPSiteMapProvider,SPContentMapProvider"
    RenderCurrentNodeAsLink="false"
    PathSeparator=""
    CssClass="s4-breadcrumb"
    NodeStyle-CssClass="s4-breadcrumbNode"
    CurrentNodeStyle-CssClass="s4-breadcrumbCurrentNode"
    RootNodeStyle-CssClass="s4-breadcrumbRootNode"
    NodeImageOffsetX=0
    NodeImageOffsetY=353
    NodeImageWidth=16
    NodeImageHeight=16
    NodeImageUrl="/_layouts/images/fgimg.png"
    RTLNodeImageOffsetX=0
    RTLNodeImageOffsetY=376
    RTLNodeImageWidth=16
    RTLNodeImageHeight=16
    RTLNodeImageUrl="/_layouts/images/fgimg.png"
    HideInteriorRootNodes="true"
    SkipLinkText="" />

Next we’ll cut and paste the content placeholder next to our main content which is inside a content placeholder PlaceHolderMain:

<div id="MSO_ContentDiv" runat="server">
    <a name="mainContent"></a>
    <asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server" />
    <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" />
</div>

And there you have it. The search box is once again visible with your v4-based master.

Edit: John Ross has an alternative opinion on search center customization but it can be hard to convince your clients that search center is something that will not follow your consistent look and feel.

Popularity: 3% [?]

23 comments to “Search Center and the Lost Search Box”

  1. Aapo Talvensaari says:

    Another option is this (better option in my opinion):

    1) Create Normal Enterprise Search Site
    2) Create new Page Layouts for Search Center Pages (look examples from PortalLayouts folder in FEATURES and clean them up, yes ootb layout files are _shit_):
    - layout for default.aspx (the main page)
    - layout for results.aspx (default search page)
    - layout for peopleresults.aspx (people search results)
    (or just use the same layout for all of them!)
    4) Provision new layouts to your site
    5) Change the layouts of the search center pages

    No need to move placeholders anymore. You just use the place holders that you want, the ones you use on all the other pages you have designed. Not the place holders that some idiot wanted to use.

    Basically the search is only a site that has a few pages that have web parts. Well there are some lists and hardcoded controls in ootb search layouts, but you can use them however you want to, or move them around wherever you want.

  2. Aapo Talvensaari says:

    And in case of SRCHCENTERLITE which is not a Publishing Site, you can replace the pages (not the page layouts in this case) just as well. I actually see no reason to use SRCHCENTERLITE if you have enterprise licence. You can remove the hardcoded tabs for example from the enterprise search and make it look exactly like SRCHCENTERLITE.

  3. MSDevGuy says:

    How do we handle the same in Sharepoint 2010 FAST search, searh input box is missing from one of the site collections Search Center

  4. Steve says:

    Thanks man! this post saved me. I got thrown on a project and these scope tabs wouldn’t show up, thanks again :)

  5. Great article – came across the issue and this was a quick fix. Note however, we did have to add a tweak – that was to override the style in the master to hide the left panel (a small box was visible). Open the page then use the F12 debug to get the style name.

  6. Amy says:

    Thanks! I would have never found this on my own. However, if you put the PlaceHolderTitleBreadCrumb above to the PlaceHolderMain content area, the breadcrumb shows up on some pages. I placed it directly after the PlaceHolderGlobalNavigation content area.
    Thanks again for the info!

  7. Franco Caprio says:

    Didn’t came across this issue but I will in the next two weeks. Thank you for the early warning ;)

  8. Using a short-phrase loan on-line will assistance small financial crunches and keep lengthy time period strikes on your credit score scores off of your credit rating record. 1 shall do the research correctly and then make a offer.

  9. games says:

    Hmm iss anyone else encountering problems with the pictures on this blog loading?
    I’m trying to find out if its a problem on my end or if it’s the blog.
    Any suggestions would be grealy appreciated.

    my web blog; games

  10. I usually do not write mqny remarks, however i did some searching and wound
    up here Search Center and the Lost Search Box | SharePint Blues.
    And I actually do have a few questions for you if it’s allright.
    Could it be only me or does it give the impression
    like some of these remarks look like written by brain dead folks?
    :-P And, if you arre posting aat additional online sites, I’d like to follow anything new you have to post.
    Could you make a list oof every one of all your shared sites like youhr Facebook page,
    twitter feed, or linkedin profile?

  11. I’ve been browsing on-line greater than three hours lately, yet I by no means found any fascinating article like
    yours. It’s pretty price enough for me. In my view,
    if all site owners and bloggers made good content as you did, the web might be a lot more helpful
    than ever before.

  12. Whether you have just finished a large, heavy meal orr you just have that
    “yucky” feeling in your stomach, you want it to go
    away. Since the serum magnesium tests are highly inaccurate,
    if your heart is being affected by your kidneys then you should have an ionized magnesium
    test done to find out the true level oof magnesium in your body.
    Dogs also require the proper balance with
    nutritional value so as to keep their health functioning optimally.

  13. Thanks in favor of sharing such a pleasant idea, piece of writing is pleasant, thats why i have read it
    completely

  14. writing made says:

    Ahaa, its fastidious conversation regarding this piece of writing at
    this place at this weblog, I have read all that, so at
    this time me also commenting here.

  15. you’re in reality a just right webmaster. The site loading velocity is incredible.
    It seems that you’re doing any distinctive trick.

    Furthermore, The contents are masterpiece. you’ve done a great job on this topic!

  16. Wow, this paragraph is fastidious, my younger sister is analyzing these
    things, thus I am going to convey her.

    Feel free to visit my webpage hookah lounge open late

  17. I am not positive the place you are getting
    your information, however good topic. I must spend some time
    studying much more or working out more. Thanks for wonderful
    information I was looking for this information for my mission.

    Feel free to visit my weblog … la plumbing charleston

  18. When someone writes an post he/she maintains the plan of a user in his/her brain that how a user can be aware of it.
    So that’s why this paragraph is amazing. Thanks!

    Stop by my blog … top rated website builder

  19. Can I just say what a comfort to uncover an individual who really knows what
    they’re talking about on the net. You certainly realize how to bring a problem to light and make it important.

    More people really need to check this out and understand this side of your story.
    I was surprised you aren’t more popular since
    you certainly possess the gift.

    Look into my webpage … karatbars international maryland

  20. Not solely does this serve the sensible goal of clearoy showing customers what its superb floral preparationns
    appear like, nevertheless it additionally makes the wweb landing pagye design,surfingbird.ru,
    extra impressive-looking.

  21. Kandi says:

    From next week i’m gonna lose weight. Summer is comming guys!
    Who starts with me? I found a good way in google and want to give it a try, simply search in g00gle; fitMarikka advices

  22. csgo weapons says:

    Passion the website– very individual friendly and whole lots to see!

  23. Awesome issues here. I am very happy to look your post. Thanks so much and I’m having a look ahead to contact you.

    Will you kindly drop me a mail?

    my site supplement agency

Leave a Reply