- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 04:45 AM
Hi everyone, I have a request where I need to change the "KB Category Page" widget, so that it shows the "Knowledge Article" number before the tittle does anyone know how to do this ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 07:38 AM
Here is a quote from the product documentation:
Base system widgets are read-only so you can benefit from future updates. To make changes, you can clone base system widgets.
For more details, see:
In a nutshell, you need to clone "KB Category Page" widget and change the following line
<a ng-href="{{kb_article.link}}">{{::kb_article.title}}</a>
as follows:
<a ng-href="{{kb_article.link}}">{{::kb_article.number}} - {{::kb_article.title}}</a>
Then replace the base system widget with your customized widget in the corresponding portal page ("kb_category").
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 07:38 AM
Here is a quote from the product documentation:
Base system widgets are read-only so you can benefit from future updates. To make changes, you can clone base system widgets.
For more details, see:
In a nutshell, you need to clone "KB Category Page" widget and change the following line
<a ng-href="{{kb_article.link}}">{{::kb_article.title}}</a>
as follows:
<a ng-href="{{kb_article.link}}">{{::kb_article.number}} - {{::kb_article.title}}</a>
Then replace the base system widget with your customized widget in the corresponding portal page ("kb_category").
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 08:29 AM - edited 07-08-2024 08:31 AM
Hi @Slava Savitsky, it worked but I had to also change somethink on the "Server Script", on the "line 75" I had to add the "number" field to the "kbFields" variable:
var kbFields = "sys_view_count,author,rating,sys_updated_on,sys_id,number";
What Im still not sure is on how they get the tittle to work since they are not getting the "short_description".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 10:24 AM
In the "Body HTML template" field, they iterate over data.items object to render information about each article. That object is set in the "Server script" field via a call to getKBCategoryArticleSummaries() function that is defined in the same field and, in its turn, calls getResultData() function of the KBPortalServiceImpl script include. That function then calls a private function _getResult() of the same script include, which finally calls SNC.SearchRequest() API to actually fetch the data. That API does not seem to be documented anywhere and its code is also not accessible for us. It seems that the logic for always returning the value of the Short Description is hardcoded in that API whereas the kbFields variable only lists additional (secondary) attributes.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/