For knowledge bases using individual reader accounts, our Recent Articles list displays a reader's most-recently-viewed articles, topic display categories, and custom content categories. These links can help readers return to content where they left off, or content they frequently reference. Your homepage is an excellent place to add this article list, though you can also add it to the right column of your layout, if you're using the right column.
This list only works with individual reader accounts. Knowledge bases with default access set to public, shared passwords, or shared IP addresses will not properly populate this list.
How does it work?
To set up, you'll add the merge code for the list where you'd like the information to be displayed. Behind the scenes, KnowledgeOwl will track up to ten of the most recently viewed articles, topic display categories, and custom content categories for each reader, and display those back to the reader in the article list.
Articles are displayed with a document icon; topic display and custom content categories are displayed with a folder.
The Recent Articles list will not show:
- Default categories
- Blog style categories
- URL redirect categories
- Articles set with URL redirects
With topic display categories, if you have the option set to Override Article Links (so that opening an article always opens it within the topic display category), when a reader views an article in the category, both the topic display category and the article will appear in their recent articles list.
Setup
By default, the reader's five most recently viewed articles will be displayed. You can change this to display between 1-10:
- Go to Settings > Basic.
- Scroll to the Article List Settings section.
- Select the dropdown next to Recent Articles and select the number of articles you'd like the list to display (1-10):
- Be sure to Save your changes.
We don't add this list to any section of your knowledge base by default.
If you'd like to add it, you'll add two merge codes into either the top-level Homepage or into the Settings > Style > Custom HTML of the relevant layouts:
[translation("article-lists:recent-articles")]
: this merge code grabs the Recent articles list heading in Tools > Customize Text > Article Lists, making it so no one has to edit the code in the future to update the title.[reader("recent-articles")]
: this merge code generates the individual reader's recent articles list.
Different setups are discussed further below.
Add the Recent Articles list to your homepage (Settings > Style)
Most knowledge bases have their article lists set in Settings > Style. If your knowledge base uses this layout, you can follow these instructions to add the Recent Articles list there. (If your knowledge base doesn't show any article lists in Settings > Style > Custom HTML > Homepage, follow the next set of instructions!)
- Go to Settings > Style.
- Below the Preview pane, be sure Custom HTML is selected.
- Select Homepage from the Custom HTML dropdown.
- Near the bottom of the code editor, find the div with class="homepage-widgets row".
- Copy one of the other article lists and paste that code in again.
- Replace the title merge code with:
[translation("article-lists:recent-articles")]
- Replace the list merge code with:
[reader("recent-articles")]
- Your code should now look something like this:
<div class="homepage-widgets row"> <div class="col-md-4 col-sm-6"><h3>[translation("article-lists:popular-articles")]</h3>[template("pop-articles")]</div> <div class="col-md-4 col-sm-6"><h3>[translation("article-lists:new-articles")]</h3>[template("new-articles")]</div> <div class="col-md-4 col-sm-6"><h3>[translation("article-lists:updated-articles")]</h3>[template("up-articles")]</div> <div class="col-md-4 col-sm-6"><h3>[translation("article-lists:recent-articles")]</h3>[reader("recent-articles")]</div> </div>
- You can Preview your changes to be sure they look right.
- Be sure to Save your changes once you're done!
Add the Recent Articles list to your homepage (top-level Homepage)
There are two ways to do this, depending on how your knowledge base is set up. If you're using our older homepage:
- In the top lefthand navigation, go to Homepage.
- Copy one of the other homepage lists and paste it in again.
- Replace the title with this merge code:
[translation("article-lists:recent-articles")]
- Replace the merge code with:
[reader("recent-articles")]
- Save.
Add the Recent Articles list to all articles
You can place the recent articles merge code and title in the HTML of all articles. To do so, it's best to create a div and add the title within a header and the article list merge code below that. We provide a code sample below you can copy and paste and adjust as you'd like:
- Go to Settings > Style
- Be sure the Custom HTML tab is selected.
- Select Article from the Custom HTML dropdown.
- Copy the code below:
<div class="recent-articles text-center"> <h3>[translation("article-lists:recent-articles")]</h3> [reader("recent-articles")] </div>
- Paste it in wherever you'd like. We recommend placing this in the hg-article-footer div, either above or below the Related Articles section:
- Once you're done adding the merge code, text, and any Custom CSS to style it, be sure to Save.
Add the Recent Articles list to individual articles
If you only want to display the Recent Articles list in certain articles, we recommend creating a snippet that includes the recent articles merge code and whatever additional formatting you'd like, and then adding that to the individual articles where you'd like the list displayed.
This helps standardize the appearance of the list, regardless of where it's added.
To do so:
- Go to Library > Snippets.
- Select the + Create New Snippet button.
- Give your snippet a Snippet Name and Snippet Description.
- In the Snippet Content, create the layout you'd like for the list (usually a heading, etc.). Add the merge code for both the list and the list heading into it. Here's a sample:
- Once you're satisfied with your snippet, select Create.
- With the snippet created, you can add the snippet into any article using the Insert Snippet option in the editor.
Add the Recent Articles list to the right column of your Knowledge Base
If you're using an older theme that shows the right column, you might decide to display the Recent Articles list in the right column of your knowledge base. To do so:
- Go to Settings > Style.
- Be sure the Custom HTML tab is selected.
- In the Custom HTML dropdown, select Right Column.
- Copy the code below and paste it in where you'd like. We recommend putting it before or after one of the existing article lists:
<div class="panel panel-default right-col-panel recent-panel"> <div class="panel-heading">[translation("article-lists:recent-articles")]</div> [reader("recent-articles")] </div>
- Be sure to Save your changes.