Compartilhar via


How to: Customize the Title and Branding Icon for Federated Search Results

Applies to: SharePoint Server 2010

If the source of a federated location is the Local Search Index, a Federated Results Web Part connected to that location shows the title of the Local Search Index in its title bar above the results. If the source is an OpenSearch location, the title bar shows the title from the OpenSearch XML feed.

By changing the XSL property of the Federated Results Web Part, you can modify what appears in the title bar for an OpenSearch results set. You can do the following:

  • Modify the title that is shown for an OpenSearch result.

  • Add a branding image to the title bar.

Note

The federated search Web Parts on the default results page are configured to use the Internet Search Results and the Internet Search Suggestions locations. The following XSLT transformation (XSLT) code does not work as expected for the default configuration for these locations.

To customize the title of a federated search results set

  1. On the Search Administration page, click Federated Locations.

  2. Under Location Display Name, click the name of your location.

  3. Expand the Display Information node.

  4. Under Federated Search Results Metadata, clear the Use Default Formatting check box.

  5. Click the ellipsis (…) button to open the Text Entry window for the location's XSL property.

  6. Locate the following tag in the XSLT.

    <xsl:value-of select="$ChannelTitle"/>
    
  7. Modify the select value for the tag by doing one of the following:

    • To use the Web Part title (the title value that is set in the Web Part's properties), modify the select value, as shown in the following code.

      <xsl:value-of select="$WebpartTitle"/>
      
    • To customize the title text, modify the select value, as shown in the following code.

      <xsl:value-of select="string('Your title text')"/>
      
  8. Click OK to close the Text Entry window.

  9. On the Edit Federated Location page, click OK to save the changes to the federated location.

    The Federated Results Web Part shows the customized title.

  10. Execute a query that returns results from the location. Verify that the new title appears as you expect.

To add a branding image to the title of a federated search results set

  1. On the Search Administration page, click Federated Locations.

  2. Under Location Display Name, click the name of your location.

  3. Expand the Display Information node.

  4. Under Federated Search Results Metadata, clear the Use Default Formatting check box.

  5. Click the ellipsis (…) button to open the Text Entry window for the location's XSL property.

  6. Locate the following tag in the XSLT.

    <xsl:param name="BrandingIcon"></xsl:param>
    
  7. Add the URL to the image you want to use to the xsl parameter tag for the BrandingIcon parameter.

    <xsl:param name="BrandingIcon">URL to image</xsl:param>
    

    Note

    Ensure that this image is sized to display appropriately next to the title of the federated search results set. We recommend a .gif file or .png file that is 16 pixels by 16 pixels.

  8. For OpenSearch federated locations only, locate the GetBrandingImage template in the XSLT by searching for the following code.

    <xsl:template name="GetBrandingImage">
    

    Remove the following code from the GetBrandingImage template.

    <xsl:when test="string-length($ChannelBrandingImage) &gt; 0 and $ChannelBrandingImage != '/s/rsslogo.gif'">
        <img src="{$ChannelBrandingImage}"/>          
    </xsl:when>
    
  9. Click OK to close the Text Entry window.

  10. On the Edit Federated Location page, click OK to save the changes to the federated location.

    The customized branding image appears in the title bar of the Federated Results Web Part.

  11. Execute a query that returns results from the location. Verify that the new title appears as you expect.

Note

If you update the federated location's XSL property, you must ensure that the Federated Results Web Part is configured to use the location's display information.

To configure the Federated Results Web Part to use the location's display information

  1. In your browser, navigate to the results page URL. For example, http://ServerName/results.aspx.

  2. Click the Site Actions link, and then click Edit Page.

  3. In the Federated Results Web Part instance you want to modify, click the edit arrow to display the Web Part menu, and then click Edit Web Part.

  4. In the Federated Results Web Part tool pane, click the Display Properties arrow.

  5. Select Use Location Visualization.

  6. Click OK to update the Federated Results Web Part instance.

See Also

Tasks

How to: View Search Results XML Data

How to: View and Edit the Search Results XSLT Transformation

Other Resources

Customizing Enterprise Search Results