This is a blog post in the series “How to set up a product-centric website in SharePoint Server 2013.” In this series, I'll use data from a fictitious company called "Contoso" to show you how to use search features to set up a website based on product catalog data. Note: Most of the features described in this series are not available in SharePoint 2013 Online.
For an overview of the blog posts in this series, go to How to set up a product-centric website in SharePoint Server 2013.
In the previous blog posts, we identified and configured the refiners we want to use for faceted navigation. In this blog post we'll learn:
Start stage 15
How to add a Refinement Web Part to a page
Browse to the page where you want to add the Refinement Web Part (RWP). In our scenario, let's browse to Cameras.
In our scenario, we'll add a RWP to Zone 2.
When you add the RWP to a page, it will display a couple of default properties such as "Author" and "Modified date". We don’t want to use these refiners. We want to use the refiners we configured for faceted navigation, so we'll have to configure the Web Part accordingly.
How to configure a Refinement Web Part to use refiners for faceted navigation
And just like that, we’ve added refiners to our page. Nice, don't you think?
To verify that our refiners actually work, select Green and Orange from the color refiner, and click APPLY. In an instant, only green and orange cameras display on the page.
So, we’ve verified that our refiners work, however, we're not quite there when it comes to user-friendliness. As things stand, the refiners are displayed as REFINABLEINT01, REFINABLESTRING01, REFINABLESTRING03 etc. As you might recall, these are the names of the refiner-enabled managed properties we used when we configured the refiners. To visitors, these names make no sense at all, so we'll have to fix them by changing their refiner display names.
How to change a refiner display name
"rf_RefinementTitle_ManagedPropertyName": "Sample Refinement Title for ManagedPropertyName",
For example, in our Contoso scenario, the refiner-enabled managed property RefinableInt01 contains a Price refiner. To give this refiner a nice display name, we'll add the following line to the java script file:
In our Contoso scenario, for the refiners we have configured for the "Audio" and "Cameras" category, our CustomString.js file will look like this:
If we browse to the Digital cameras category, we can see that the category-specific refiner MEGA PIXELS is displayed.
So, our category-specific refiners now display for the correct category, and they all have user-friendly names. However, there is another small detail that would make our refiners even better. Right now we can't see any numeric details for the refiner values. For example, we can't see how many cameras are of the color Silver, or how many cameras have 14 mega pixels. To see this information, we need to add counts to the refiner values.
How to add counts to refiner values
Now when we refresh the Cameras page, all of the refiner values have counts. Nice!
So, when visitors come to our Contoso site, they can use category-specific refiners to easily find the product they’re looking for. But there’s still one more thing missing: when visitors are on a top level category page, for example Cameras, they can't easily see which subcategories are under Cameras. Luckily, there is a Web Part that will take care of this for us. I will show you how to add this Web Part in the next -- and last -- blog post of this series.
Next blog post in this seriesStage 16: Add a Taxonomy Refinement Panel Web Part to a publishing site
Additional resourcesConfigure Search Web PartsScenario: Create SharePoint sites by using cross-site publishing in SharePoint Server 2013