How to change the search refinement category label in SharePoint 2010

Search refinements in SharePoint 2010 use the display name of the fields in the filters’ categories. If the field is a custom one, then you can choose your own display name. But for default SharePoint fields you can't change the display name.

Original label
Original label

If you just want to change the word that appears in the search refinements category, then there’s an easy way to achieve it.

Edit the page and the search refinements panel webpart. On the webpart’s options panel go to “Data View Properties” > “XSL Editor...”

Copy all the code that you see in the popup window to a text file.

Search for the text "ms-searchref-categoryname".

You should find this:

<div class="ms-searchref-categoryname">
    <xsl:value-of select="$DisplayName"/>
</div>

Now, let’s add some conditions to show what we want:

<div class="ms-searchref-categoryname">

<xsl:choose>

<xsl:when test="$DisplayName='Modified Date'">

Modified on

</xsl:when>

<xsl:otherwise>

<xsl:value-of select="$DisplayName"/>

</xsl:otherwise>

</xsl:choose>

</div>

You can add as many options as you like here. I’m just changing the modified date.

Copy back the new code to the popup window and save it.

Last step: on the webpart’s options panel, expand the section “Refinement” and uncheck the option “use default configuration”. If you don't do this the code will revert to the default when you save the webpart.

Save and enjoy.

Modified category label
Modified category label
Dércia Silva
Posted by Dércia Silva on July 31, 2013

Related articles