The CreatorCon Call for Content is officially open! Get started here.

How to set default knowledge base and show their categories on initial form load

Rhonda9
Tera Expert

Hello, 

I have a requirement to make Self Service Knowledge base the default KB and show their categories on initial form load in the Employee Center.  There are 2 widgets working together . On the select box KB Knowledge Bases  widget, I am able to make self service the default but the KB Categories widget is not showing the self service, instead it is showing all categories.   

 

I would like to accomplish one of these :

A. make self service Knowledge base and its categories show by default when form loads 

or 

G. Hide the "All" option and only show the categories that belong to the specific KB Knowledge base.  

There are currently 4 knowledge bases visible based on user role.

 See screenshot below: 

Rhonda9_0-1739292263458.png

 

1 REPLY 1

ShuguangS
Tera Contributor

Hi, you need add some extra code in the client script section of widget kb-knowledge-bases to force refresh of page:

    if (c.data.selectedIndex == 0) {
        $scope.selectedKB = c.data.kbArr[1]; // or what ever position your KB is in the array
        $timeout(function() {
            $scope.changeKB($scope.selectedKB);
        });

    } else {
        $scope.selectedKB = c.data.kbArr[c.data.selectedIndex];
    }