How to hide the number shown on the portal for total KB articles in each category

bostonsnow
Kilo Guru

Hello all,

Does anyone know how to hide the number shown next to Knowledge categories on the portal?

find_real_file.png

Thanks!

Mike

1 ACCEPTED SOLUTION

rajneeshbaranwa
Giga Guru

Navigate to the designer view of KB_view2 page and open it in designer view. Click on Pen Icon in KB Categories - KBv3 and select Omit Badge counts. 

 

This will remove the count from the widget

 

find_real_file.png

View solution in original post

17 REPLIES 17

bostonsnow
Kilo Guru

I just discovered that I can hide the quantity by editing the "KB Categories KBv3" widget and selecting "Omit badge counts (can improve performance for large categories)". This does hide the quantity but once I click on any category the quantity for all categories is displayed again. Any ideas on how to permanently hide this?

Jaspal Singh
Mega Patron
Mega Patron

Hi,

 

You need to clone widget: KB Categories - KBv3 & then comment the line that has keyword "category.count" from Body HTML Field of the widget.

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

Hi Jaspal, thanks for the response!

"category.count" appears in a few different places, do you which one specifically needs to be commented out? I tried a combination of options and can't get that count to hide.

------------------------------------------------------

<div ng-show="data.kb" ng-class="{'hidden-xs' : hideCategoryWidgetInXS}" class="panel panel-{{::c.options.color}} category-widget no-border" ng-if="::(data.show == true)">
<div class="panel-heading">
<h1 class="h4 panel-title" ng-bind="::c.options.title">
<fa ng-if="c.options.glyph" name="{{c.options.glyph}}" />
</h1>
</div>
<ul class="list-group category-list" role="list" aria-label="${Categories}">
<li role="listitem"
class="list-group-item text-overflow-ellipsis"
ng-include="'category-template.html'"
ng-repeat="category in c.data.categories track by category.value "
ng-if="category.count != 0">
</li>
</ul>
<div class="panel-footer text-center" ng-if="data.showMore">
<a href="javascript:void(0)" role="button" class="text-center" ng-click="loadMore()" >{{::data.showMoreMsg}}</a>
<div class="text-muted text-center">
{{data.loadAllMsg}}
</div>
</div>
</div>

<script type="text/ng-template" id="category-template.html">
<div ng-click="categorySelected(category)"
ng-enabled="category.count != 0"
tabindex="0"
class="group-item group-item-{{::options.color}}">
<i ng-if="::category.subcategories.length > 0"
class="l-h-1_6x pull-left fa"
ng-class="{true: 'fa-minus-square-o', false: 'fa-plus-square-o'}[category.showChildren]"
aria-label="{{category.showChildren? '${collapse category} ' + category.label : '${expand category} ' + category.label}}"
ng-click="displayChildren($event, category)"/></i>
<span ng-if="category.count > 0 && options.omit_badges != 'true'" class="badge pull-right pointer">{{::category.count}}</span>
<span class="block text-overflow-ellipsis category"
sn-focus="category.value == c.data.categoryId"
ng-class="{true: 'text-{{::options.color}}', false: ''}[category.value == c.data.categoryId]" id="{{::category.value}}"
title="{{::category.label}}">
{{::category.label}}
<span class="sr-only">${items}</span>
</span>
</div>
<ul class="list-group sub-category-list list-bg-{{::options.color}}"
role="list" aria-label="{{category.label}} ${subcategories}"
ng-if="category.showChildren && category.subcategories.length >0"
ng-class="{true: 'no-indent', false: ''}[category.level > 2]">
<li role="listitem"
class="list-group-item text-overflow-ellipsis"
ng-include="'category-template.html'"
ng-repeat="category in category.subcategories | orderBy: 'label' track by category.value "
ng-if="category.count != 0">
</li>
</ul>
</script>

------------------------------------------------------

Hi,

 

Try replacing

<ul class="list-group category-list" role="list" aria-label="${Categories}">
<li role="listitem"
class="list-group-item text-overflow-ellipsis"
ng-include="'category-template.html'"
ng-repeat="category in c.data.categories track by category.value "
ng-if="category.count != 0">
</li>
</ul>

with

<ul class="list-group category-list" role="list" aria-label="${Categories}">
<li role="listitem"
class="list-group-item text-overflow-ellipsis"
ng-include="'category-template.html'"
ng-repeat="category in c.data.categories track by category.value">
</li>
</ul>

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.