Knowledge Bases Browse Widget: Change the page users are sent to

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2023 02:55 PM
When clicking a knowledge base from the kb_home page. The "Knowledge Bases Browse" widget takes users to the "kb_search" page, I want to take them to the "kb_category" page for the selected knowledge base.
I've copied the "Knowledge Bases Browse" widget already, so how can I accomplish this ask?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2023 12:11 AM
Hi @Edwin Fuller,
You need to clone the "knowledge Homepage Search [kb-homepage-search] widgets and update the page id in client controller.
Client controller:
c.submitSearch = function() {
if(!((!c.data.allow_empty_search && c.keyword == "") || (c.keyword && c.keyword.length < c.data.min_search_char))) {
var url= $location.search({
id: 'kb_category',
query: c.keyword
});
spAriaFocusManager.navigateToLink(url.url());
}
else if(c.keyword && c.keyword.length < c.data.min_search_char)
spUtil.addInfoMessage(c.data.messages.MIN_CHARS_REQUIRED);
};
If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers! 👍🏻
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 12:35 PM
Hi I was trying to do the same thing, I cloned the widget and replaced the line item in the Body HTML template: <a href="?id=kb_search&kb_knowledge_base={{::item.sys_id}}" aria-label="${{{::c.getKBLabel(item.title,item.article_count,item.questions_count,item.enable_socialqa)}}}">
to
<a href="?kb_id={{::item.sys_id}}&id=YOUR KB HOME PAGE" aria-label="${{{::c.getKBLabel(item.title,item.article_count,item.questions_count,item.enable_socialqa)}}}">
Replace where it says YOUR VIEW to the knowledge homepage (kb_knowledge_page). Hope that helps, it's working for me so far!