Favorites is designed to be used with individual reader accounts, so we recommend only enabling it if your knowledge base has an option to log in. (If you are using Public Default access, enabling it won't hurt anything--anyone who's not logged in just won't see the star to favorite an article, and any article lists you add to display favorites will show empty for them.)
Getting favorites fully set up is generally a multi-step process, in which you:
- Enable the feature.
- Adjust your Article Custom HTML to be sure it has a merge code that includes the favorites action.
- Figure out where you'd like to display favorites in your theme: you can choose to add it to the table of contents or you can use a merge code to add to your homepage or right column, depending on your theme layout.
Steps 1 and 2 are outlined below; see the linked resources in step 3 for more details on those!
Enable favorites
Our default Editor role has permission to enable article favorites. If you're using a custom author role, that role must have the Admin Permission to Update article favorites settings.
To enable favorites in your knowledge base:
- Go to Settings > Article Favorites.
- Check the Enable article favorites checkbox to turn the feature on.
- While you're here, if you'd like to add favorites to your table of contents, you can also check the Show article favorites in the table of contents checkbox. (See Display favorites in the table of contents for more information.)
- Be sure to Save your changes.
Adjust your Article Custom HTML
Once you've turned on the feature, you also may need to make some tweaks to your article layout before you'll see the favorites star:
- Go to Settings > Style.
- Below the preview pane, be sure Custom HTML is selected.
- In the Custom HTML dropdown, select Article.
- In the Article Custom HTML, if you see the
article("action_icons")
template, you don't need to do anything else! - If you don't see the
article("action_icons")
template, you probably have hard-coded HTML for your article actions, which usually looks like this: - You have two options:
- You can highlight all of the HTML for the ko-article-actions span, remove it, and replace it with the
article("action_icons")
template. For more detailed instructions, see Update your article actions merge code. - If you don't want to touch that HTML, you can add a new merge code into the HTML to enable the favorites icon. To do so:
- In the -- Select a Merge Code -- dropdown below the HTML pane, find the Article Merge Codes section.
- Select the Article Favorites Action from the dropdown.
- You can either put your cursor where you need in the HTML and hit the Insert button, or copy the merge code and paste it in.
- If your Article HTML looks like that in the screenshot above, you'll want to insert the merge code between the
</a>
and the</span>
, like this:
- You can highlight all of the HTML for the ko-article-actions span, remove it, and replace it with the
- You can Preview your changes to be sure they look good.
- Just be sure to Save your changes once you're done!
Any one of these approaches should add a star in your article actions section as long as you enabled Favorites first:
Readers can click on that star to add it to their Favorites list.