dppedersen
Mega Contributor

Hello,

I noticed there was no OOTB Knowledge Categories widget that shows subcategories, so I made one. The code for client controller, server script, body HTML, and CSS is here: https://github.com/dppedersen/SNOW_knowledge_categories_and_subcategories_widget

Clicking a 'closed folder' category name will display the subcategories. Clicking again will hide them. Clicking a name with no folder will take you to the category page. Clicking a number at any time will take you to that category page. Styling may require some configuration based on the instance, and you will need to set the widget title in the options.

I know there was an option for implementing this floating around the Share store, though it may have been removed for a time, and it only allows for up to 3 category depth. This version allows for infinite category nesting, and is a somewhat simpler and more extensible UI. I hope it helps someone out!

Duncan

find_real_file.png

Comments
Meredith E
Kilo Contributor

Thanks - this is awesome! What would I need to change to alphabetize the categories? Mine are showing up unsorted

Fredrik5
Kilo Explorer

Not sure if you found the solution for this but in the Server Script there is 2 GlideRecords to fetch the categories. You should be able to get them in the order of your choice if you add a .orderBy before the query.

Nen
Tera Guru

Thanks! I did some modifications and it's working for me, too.

find_real_file.png

 

I just have a question, is there a way for the nested view not to go back to this view when I click on a category name?

find_real_file.png

Thanks!

Waru
Tera Contributor

I have the same question as @Nen ,how do you make it not collapse the whole tree when you select an article?

MANASWINI3
Tera Contributor

Hello @Nen ,

 

Were you able to achieve the question you asked to show the nested view for categories. If possible can you share the modifications you made to achieve the one you shared in the screenshot.

 

Thank you in advance.

 

Version history
Last update:
‎08-26-2018 01:57 PM
Updated by: