Tag: SharePoint Search

How to add or remove languages from Advance Search Page in SharePoint 2010

Changing the language list on Advance search page is very simple, just follow these steps.

Step 1: Go to Advance page, site actions and then edit page.

Step 2: Now edit advance search box web part and collapse properties section.

Step 3: Copy xml from properties textbox and paste it in any xml editor like Visual Studio so we can modify it easily

Step 4: Search for languages tag and remove any language that is not necessary from the list. For example let’s remove all languages except English from the list, now it should look like

<Languages>
<Language LangRef="en" />
</Languages>

Step 5: To add another language, just add another Language element with LangRef attribute. Values for LangRef attribute will LangID from the LangDefs element. For example if we want to add Arabic then our Languages element would look like

<Languages>
<Language LangRef="en"/>
<Language LangRef="ar"/>
</Languages>

Step 6: Copy the entire xml and paste it in properties textbox in advance search box web parts (Where we initially copied the xml from) and save the page.

That’s it we are done.

I hope you find this post useful. Thanks

Advertisements

How to add global navigation in SharePoint 2010 Fast or Enterprise Search Center Sites

This post describes how we can add global navigation in SharePoint 2010 Search Center sites.

Search center sites use minimal master page which doesn’t include global navigation controls. Even if we change site’s master page (To change master page, publishing feature has to be activated) from minimal to v4 or nightandday global navigation will not appear and we’ll see some strange results like search textbox going behind the ribbon. The reason for this is that the controls which render global navigation are not in minimal master page, they are in page layouts. So let’s start our short journey.

Step 1: Open root site in SharePoint Designer, go to All Files, _catalogs and then masterpage

Step 2: We’ve to change SearchMain.aspx (default page containing search text box), SearchResults.aspx (which shows search results) and AdvanceSearchLayout.aspx (which has advance search controls) respectively

Step 3: Let’s start with SearchMain.aspx, click this file, edit it and then click Advance mode button at the top so we can do the desired changes.

Step 4: Search for srch-sb-main, we’ve to paste the following code which renders the global navigation before div with class srch-sb-main

<div class="s4-lp s4-toplinks" style="background-image:url(/_layouts/images/selbg.png); background-repeat:no-repeat;
repeat-x:left top; background-color:#f6f6f6; vertical-align:middle; min-height:25px; border-top:1px solid #e0e0e0;
border-bottom:1px solid #b8babd">

<SharePoint:AspMenu
ID="TopNavigationMenuV4"
Runat="server"
EnableViewState="false"
DataSourceID="topSiteMap"
AccessKey="<%$Resources:wss,navigation_accesskey%>"
UseSimpleRendering="true"
UseSeparateCss="false"
Orientation="Horizontal"
StaticDisplayLevels="2"
MaximumDynamicDisplayLevels="1"
SkipLinkText=""
CssClass="s4-tn"/>

<SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource" Id="topNavigationDelegate">
<Template_Controls>

<asp:SiteMapDataSource
ShowStartingNode="False"
SiteMapProvider="SPNavigationProvider"
id="topSiteMap"
runat="server"
StartingNodeUrl="sid:1002"/>

</Template_Controls>
</SharePoint:DelegateControl>

</div>

Step 5: Let’s save our page and view it in browser.

Step 6: Okay we got our global navigation on search page, now let’s add it in search results page. So let’s edit SearchResults.aspx in advance mode

Step 7: Search for srch-sb-results, we’ve to paste the code from step 4 which renders the global navigation before div with class srch-sb-results

Step 8: Search for PlaceHolderMain, we’ve to paste the code from Step 4 which renders the global navigation inside the content place holder with id PlaceHolderMain