Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
2 added 14 characters in body
source | link

If it works hard-coded, try trimming your variable:

set searchQuery = searchQuery|trim

OR Build, even better, build an array:

{% set categories = [] %}

{% for category in currentUser.kb__category %}
   {% set categories = categories|merge(category.id) %}
{% endfor %}


{% for category in craft.categories
  .group('knowledgeBase')
  .id(categories)
  .level(1)
  .all()
%}

If it works hard-coded, try trimming your variable:

set searchQuery = searchQuery|trim

OR Build an array

{% set categories = [] %}

{% for category in currentUser.kb__category %}
   {% set categories = categories|merge(category.id) %}
{% endfor %}


{% for category in craft.categories
  .group('knowledgeBase')
  .id(categories)
  .level(1)
  .all()
%}

If it works hard-coded, try trimming your variable:

set searchQuery = searchQuery|trim

OR, even better, build an array:

{% set categories = [] %}

{% for category in currentUser.kb__category %}
   {% set categories = categories|merge(category.id) %}
{% endfor %}


{% for category in craft.categories
  .group('knowledgeBase')
  .id(categories)
  .level(1)
  .all()
%}
1
source | link

If it works hard-coded, try trimming your variable:

set searchQuery = searchQuery|trim

OR Build an array

{% set categories = [] %}

{% for category in currentUser.kb__category %}
   {% set categories = categories|merge(category.id) %}
{% endfor %}


{% for category in craft.categories
  .group('knowledgeBase')
  .id(categories)
  .level(1)
  .all()
%}