"Explore Our Knowledge Bases" to Expand "Show All" by Default

keygw
Tera Guru

We would like to set our Knowledge Portal to auto expand the "Show All" for our knowledge bases. Is there a property that can make this change?

 

find_real_file.png

2 REPLIES 2

Steven M1
Tera Contributor

Without cloning the "Knowledge Base Browse" widget and changing the default behavior, you can add the following CSS to the instance options of the OOB widget.

.kb-hide-me {
  display: block; 
}

.kb-show-more {
  display: none;
}

 

The first block will show all knowledgebases as if you had clicked the "Show all +" button but it will also remove the ability to hide them, so the second block gets rid of the show/hide button completely.
This is the most OOB/Upgrade Friendly way to do it.


Alternatively you could clone the widget and change Client Controller script line 7 from "c.showMoreLink = true;" to "c.showMoreLink = false;"

Or, even more fancy, you could clone, add the following to the end of the "Option schema" array:
{"hint":"Show all by default","name":"show_all","default_value":"false","label":"Show All","type":"boolean"}

Add this line to the server script after "options.order_reverse = options.order_reverse ? options.order_reverse == 'true': false;":
options.show_all = options.show_all ? options.show_all == 'true': false;

Change Client Controller line 7 from
"c.showMoreLink = true;" to "c.showMoreLink = !c.options.show_all || true"

This will give you the ability to choose if you want to show all by default or not when using your new cloned widget.

 

 

Thanks, this worked!