How can I make KB categories and subcategories with the order i want in Tokyo?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2023 10:47 PM
I have read and try some way which many people is asking / sharing on internet like this.
Unfortunately, the ways provided were all failed in my instance.
Below screen capture is what I want.
But it always goes
- KB Categories
- Sub Cat.
- Cat. A
- Cat. B
- Others
- Report
- TimeSheet
- ITSM
Please help!
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2023 12:30 AM
I read the link you posted .
I think it really can slove your problem.
If you failed . please check
1. did you modify the right widget ?
2. if the widget can't be modified directly , you need to clone it and modify the cloned one ,then replace the cloned one to the page.
and if the page using the widget can't be modified directly ,
you need to clone the page and replace the widget with the cloned one, and then modify the link to the new page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2023 05:39 PM
Hi newhand,
Thank you for replying.
I did clone the widget (KB Categories - KBv3) and edit the page with the cloned widget.
But it's not working.
And below is Server Script and HTML Script
Server Script :
HTML Script :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2023 07:01 PM
I read the codes , and find that the place you modified just effects on the top level categories.
You also need to change the sort for the sub categories.
serve-side script Line : 145 ~
var subcategories = new GlideRecord("kb_category");
subcategories = $sp.getSubCategories(cats.getUniqueValue());
// I can't find any information about $sp.getSubCategories,
// But i guess the results is GlideRecord, have a try to use a normal query with sort instead of this line.
categoryDetails.subcategories = [];
while (subcategories.next()) {
var category = getCategory(subcategories, level+1);
if (category.count != 0) {
categoryDetails.subcategories.push(category);
}
categoryDetails.showChildren = categoryDetails.showChildren || category.showChildren;
}