Initial Setup for a Knowledge Base

1. We start with a set of documents for our Knowledge Base. They are in a new Content Type and we have added in some fields to make it easier to organize and search.

Document page on SharePoint for knowledge base

2. We can create views to try and organize this library, but there are alternatives that can provide some nicer landing pages and options for our users. We have already populated the library with some categories and tags to help with this. We have also added a column called KBFeatured which will let the user designate a particular article to be featured on a part of the page.

Use the Content Query Web part to create an Knowledge Base Page

Add a Web Part

3. After creating a new page for this dashboard (a Welcome Page with Web Parts in the Pages library), we can start adding web parts. This page will be using just the Content Query web part without any Search capabilities. This is useful if we do not have access to Search, or our administrator will not add the new fields we need to search.

Content Query and Content Rollup Selected

4. We will add the Content Query Web Part to the page.

Steps in Query

5. Now select Show items from the following list: and click Browse… to select the list containing our KB Articles. Just in case we are housing any other documents in that library, we can restrict this to Custom Content Types and select KBDocs to ensure only KB Articles are shown. Finally, we will be adding another filter so that we only show the featured articles on this part of the page by selecting Show items when: KBFeatured is equal to [Yes].

Knowledge base grouping and sorting

6. Now sort items by: Created and Limit the number of items to display to 3. This will ensure that only the latest 3 featured articles are shown. Also set the Item Style: to Title only

Knowledge base title is featured articles and the Chrome type is title and border

7. Now rename the Title to Featured Articles and set the Chrome Type to Title and Border. Finally, click OK.

Content rollup and content query are selected

8. Now we will add a second Content Query web part to the center of the page which will the latest 20 articles out of all articles.

adding second content query to knowledge base

9. Select the correct list and content type again, but this time do not select any filters.

knowledge base content type

10. Here we will Group items by: KBCategory, Sort items by: Created, and Limit the number of items to display to 20.

11. Set the Title to All Articles and the Chrome Type to Title Only

Knowledge Base: Title = All articles

12. Now we have basic Knowledge Base page for our users.

Example of knowledge base title as All Articles

Knowledge Base Page with Search Web Parts

For these demos, we need to make sure we are using site columns and NOT list columns. This is important because, in order to use the search web parts with the data we want, those columns need to be added to the search index. Don’t forget that your search administrator will need to check the options on these columns once they are added to the index as managed metadata columns, to make them searchable, queryable, refinable, etc.

1. Again we start with a blank web part page and click on Add a Web Part

Insert search-driven content and popular items

2. Select the Search-Driven Content category and then select the Popular Items web part. This web part will show the most popular articles that are being read by users.

Select change query and two lines

3. In the properties for the web part make the Item display template Two lines and click Change query

add your refiners

4. Click on the REFINERS tab then select KBDocs under the SPContentType section, then click Add.

Title is popular articles and Chrome type is title and boarders

5. Now we can finish up the web part by changing its Title and Chrome Type

SharePoint Categories and Parts

6. Underneath the previous web part add another one called Recently Changed Items. We will be showing the latest items that have also had a column checked to make them “featured” in this web part.

Select Change Query and two lines
Select yes in SharePoint

7. Under Display Templates select Two lines in the Item options since we won’t have any pictures associated with these items. We will also Change Query by adding the KBFeaturedOWSBOOL column with a Yes value selected. This will ensure that only items that have the KBFeatured checkbox checked will be displayed here.

Select feature articles in SharePoint

8. Finally, we set the Title and Chrome Type

Select search folder in Sharepoint

9. Next we focus on the middle of the page and add a Search Box web part from the Search category

Send queries to a column in SharePoint

10. Here we will set the page that will load the results from this search box. We will create the page in the Knowledge Base Search Results Page Section. Select Send queries to a custom results page URL then type in the URL of your search page.

Select title only for knowledge base dashboard

11. Then just set the Title and Chrome Type

Select search folder in Knowledge base dashboard

12. We will now add predefined search results to the page by selecting the Search Results web part

change query in knowledge base

13. In the web part properties select Change Query

Add content type property filter to Knowledge base dashboard

14. Here we will be writing our own custom query. Basically what we want to do is add a property filter by typing in or selecting ContentType:KBDOCs. This will show only results that contain the string KBDOCs to prevent anything other than articles from being displayed on the page.

Knowledge base search results preview

15. If we click Test query we can see our results in the preview pane. Make sure you see what you expect here before proceeding.

Title select article results in Knowledge base dashboard

16. Set the Title and then set the Chrome Type to None since we just want to display the items.

category and parts folders in Knowledge base dashboard

17. Finally add the last web part above the results by selecting the Refinement web part. Here we will be using it just to display the Article Categories which will filter our displayed articles on the page.

refinement target in knowledge base dashboard

18. Once the web part is added Select Article Results as the Refinement Target to ensure the correct web part is updated by this filter. Then click on Choose Refiners…

select available refiner in knowledge base

19. First remove all of the existing refiners. Then select KBCategoryOWSCHCS, which was the managed property created for our KBCategory choice field and Add >. You will see some Sample Values in the preview pane.

Select article category in knowledge base

20. In this same pane change the Display Name of the refiner and click OK

select article category in knowledge base

21. Set the Title and set the Chrome Type to none so we only see the specific categories available along with the Refiner Display Name

search for an article in knowledge base

22. Now our Knowledge Base dashboard is complete.

Knowledge Base Search Results Page

New page document in SharePoint

1. In the last section, we created the Knowledge Base Dashboard. On the Search Box web part, we pointed it to a specific search results page. In this section, we will create that page. Begin by creating a new Page in the Pages Library.

Create new page in Knowledge base

2. Name the page the same as what we pointed the Search Results web part to and select the Search Results Welcome Page as the page Layout. Note that we need the Publishing Features enabled at both the site collection and site levels.

Delete search navigation on Knowledge base

3. Several web parts have already been added for us. Since we will only be displaying Knowledge Base Articles we can delete the Search Navigation Web Part.

Select edit web part in Knowledge base

4. Now go ahead and edit the Search Results web part

Select Change query in Knowledge Base

5. Click on Change query

basic query settings in knowledge base

6. We will be setting the query to the same filter as we did for the Knowledge Base Dashboard page. ContentType: KBDocs

result settings knowledge base

7. Since we are only displaying Knowledge Base Articles in English in this example, uncheck the Show advanced link and Show language dropdown

select edit web part in knowledge base

8. Finally, we will edit the Refinement web part

choose refiners in knowledge base

9. Select Choose Refiners…

add refiners in knowledge base

10. Add both the KBCategoryOWSCHCS and the owsKBTag refiners and remove all but the FileType, DisplayAuthor, and LastModifiedTime refiners. Since this is a full search results page, we want to give the user multiple options for further refining their search results. Note how the two columns we created needed to be added to search, while the others were already there by default.

selected refiners in knowledge base

11. Adjust the order of the refiners to highlight our custom fields

knowledge base search results

12. Now we have a fully functional search results page for our Knowledge Base Articles