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.
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
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.
4. We will add the Content Query Web Part to the page.
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].
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
7. Now rename the Title to Featured Articles and set the Chrome Type to Title and Border. Finally, click OK.
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.
9. Select the correct list and content type again, but this time do not select any filters.
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
12. Now we have basic Knowledge Base page for our users.
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
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.
3. In the properties for the web part make the Item display template Two lines and click Change query
4. Click on the REFINERS tab then select KBDocs under the SPContentType section, then click Add.
5. Now we can finish up the web part by changing its Title and Chrome Type
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.
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.
8. Finally, we set the Title and Chrome Type
9. Next we focus on the middle of the page and add a Search Box web part from the Search category
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.
11. Then just set the Title and Chrome Type
12. We will now add predefined search results to the page by selecting the Search Results web part
13. In the web part properties select Change Query
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.
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.
16. Set the Title and then set the Chrome Type to None since we just want to display the items.
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.
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…
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.
20. In this same pane change the Display Name of the refiner and click OK
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
22. Now our Knowledge Base dashboard is complete.
Knowledge Base Search Results Page
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.
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.
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.
4. Now go ahead and edit the Search Results web part
5. Click on Change query
6. We will be setting the query to the same filter as we did for the Knowledge Base Dashboard page. ContentType: KBDocs
7. Since we are only displaying Knowledge Base Articles in English in this example, uncheck the Show advanced link and Show language dropdown
8. Finally, we will edit the Refinement web part
9. Select Choose Refiners…
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.
11. Adjust the order of the refiners to highlight our custom fields
12. Now we have a fully functional search results page for our Knowledge Base Articles