- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 08-26-2018 01:57 PM
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
- 4,206 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks - this is awesome! What would I need to change to alphabetize the categories? Mine are showing up unsorted
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
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.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks! I did some modifications and it's working for me, too.
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?
Thanks!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I have the same question as @Nen ,how do you make it not collapse the whole tree when you select an article?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
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.