"Knowledge Search" filter open by default

dmerino
Tera Contributor

Hi community,

I have a requirement which is related to "Knowlegde Search" (kb_search) page. I want to know if it's possible to configure the left filter "Knowledge Search" to be always expanded as shown below:

 

knowledge.jpg

 

Thanks in advance for your help.

Cheers

1 REPLY 1

Patrick85
Tera Guru

I solved this with a new "invisible" widget on the page that only contains the following client code. 

 

function($scope, $timeout) {
  // wait for the KB widget to render…
  $timeout(function() {
    // desktop “Filters” button
    var desk = document.getElementById('showFilterBtn');
    if (desk) {
      desk.click();
      return;
    }
    // mobile “filter‐icon”
    var mob = document.querySelector('.filter-icon[aria-label="Show filters"]');
    if (mob) mob.click();
  }, 500);
}