# Knowledge Base

**URL:** https://meta.discourse.org/t/knowledge-base/121898
**Category:** Theme component
**Tags:** deprecated
**Created:** [July 2, 2019, 3:32pm UTC](https://meta.discourse.org/t/knowledge-base/121898 "2019-07-02T15:32:23Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [July 2, 2019, 3:32pm UTC](https://meta.discourse.org/t/knowledge-base/121898/1 "2019-07-02T15:32:23Z")

</div>

> ⚠ The functionality of this theme component has been replaced by the [Discourse Docs](https://meta.discourse.org/t/discourse-docs-documentation-management/130172) plugin

This theme component enables a knowledge base style view for selected categories.

#### 🔗 [Repository Link](https://github.com/discourse/discourse-knowledge-base-theme)

#### 🔗 [Preview on Theme Creator](https://theme-creator.discourse.org/theme/justindirose/knowledge-base)

 ![31%20AM](https://global.discourse-cdn.com/meta/original/3X/6/2/62732b72800d4ea30613325ebbdbf23776853997.png)  
A KB button is added to the nav pills for any categories enabled in the settings.

 ![40%20AM](https://global.discourse-cdn.com/meta/original/3X/3/b/3bdfc7eed1d2e1b44e48609a268f1e10704156aa.png)

Once toggled into the view, the knowledge base shows a stripped down version of the latest topic list.

 ![50%20AM](https://global.discourse-cdn.com/meta/original/3X/0/8/089068ee91f0f6763d5603b2e4bdb4d8f8474201.png)

Click a tag in the sidebar and the topic list automatically filters by that tag. You can select as many tags as you want, and the tag list will show only tags added to the filtered topics for ease of browsing lots of documentation.

 ![01%20AM](https://global.discourse-cdn.com/meta/original/3X/2/d/2d3d421378696fe97c854f4632ff7bff5abc2965.png)

Want to search? Just type a term in the box. Search results are also restricted to any tags you have selected.

### Considerations

The following site settings are **required** for this component to function: `tagging enabled` and `show filter by tag`

~~This theme component does not currently have a mobile view.~~

That being said, we’re working on building a more advanced version of this. We’ll be sure to let you know here on Meta when it’s ready!

---

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [July 9, 2019, 4:03pm UTC](https://meta.discourse.org/t/knowledge-base/121898/8 "2019-07-09T16:03:58Z")

</div>

This commit now adds a basic mobile view.

> <https://github.com/discourse/discourse-knowledge-base-theme/commit/d0964e52f4c4d5721f8e9fa3d243ffc953256e0a>

Note it’s not perfect, as if there are lots of tags, you do scroll over them. There are a couple of ideas I’m considering to fix that.

---

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [July 10, 2019, 1:35pm UTC](https://meta.discourse.org/t/knowledge-base/121898/9 "2019-07-10T13:35:08Z")

</div>

We’ve been using Discourse as our KB for 4+ years and have around 350 Knowledge Base specific posts, so this very exciting!

I’m not sure if this is possible via a theme component, but is there anyway this “view” could be the default when someone opens a category? So that rather than going to: `/c/knowledge-base` that it would automatically load as `/c/knowledge-base?kb=active`?

We’ve enabled the KB theme component and really like it but we worry that people aren’t seeing the KB view because they’re using the `/c/knowledge-base` link they’ve previously bookmarked.

Thanks for your work on this.

---

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [July 10, 2019, 1:41pm UTC](https://meta.discourse.org/t/knowledge-base/121898/10 "2019-07-10T13:41:18Z")

</div>

I’ll look into adding a setting for this! Thanks for the suggestion, and glad you’re finding this useful.

---

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [July 13, 2019, 1:34am UTC](https://meta.discourse.org/t/knowledge-base/121898/11 "2019-07-13T01:34:06Z")

</div>

> [@wesochuck](#):
>
> I’m not sure if this is possible via a theme component, but is there anyway this “view” could be the default when someone opens a category? So that rather than going to: `/c/knowledge-base` that it would automatically load as `/c/knowledge-base?kb=active` ?

This is now implemented as a theme setting. Subcategories are now supported, too!

---

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [July 13, 2019, 4:01am UTC](https://meta.discourse.org/t/knowledge-base/121898/12 "2019-07-13T04:01:53Z")

</div>

Just updated. Looks great, thank you!

---

<div class="post-metadata">

### Author: ![Sean\_R](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sean_r/32/72433_2.png) [@Sean\_R](https://meta.discourse.org/u/Sean_R)
#### Post date: [August 18, 2019, 1:15pm UTC](https://meta.discourse.org/t/knowledge-base/121898/13 "2019-08-18T13:15:19Z")

</div>

How do you apply this to a subcategory? Is there a special syntax?

---

<div class="post-metadata">

### Author: ![TowerBR](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/towerbr/32/152148_2.png) [@TowerBR](https://meta.discourse.org/u/TowerBR)
#### Post date: [August 19, 2019, 12:08am UTC](https://meta.discourse.org/t/knowledge-base/121898/14 "2019-08-19T00:08:05Z")

</div>

Thank you so much for this! We have a category in our community that would be perfect for applying this component, but we are facing an issue: categories don’t show up in the “kb categories” drop down so we can’t choose the category to apply the component. Any advice?

---

<div class="post-metadata">

### Author: ![Sean\_R](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sean_r/32/72433_2.png) [@Sean\_R](https://meta.discourse.org/u/Sean_R)
#### Post date: [August 19, 2019, 12:26am UTC](https://meta.discourse.org/t/knowledge-base/121898/15 "2019-08-19T00:26:35Z")

</div>

You can just type in the category slug and create it. It is not extremely intuitive. I have not been able to figure out how to get sub categories but if your category is on the first level it is pretty easy.

---

<div class="post-metadata">

### Author: ![TowerBR](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/towerbr/32/152148_2.png) [@TowerBR](https://meta.discourse.org/u/TowerBR)
#### Post date: [August 19, 2019, 1:10am UTC](https://meta.discourse.org/t/knowledge-base/121898/16 "2019-08-19T01:10:32Z")

</div>

Ok, really not intuitive. I typed and “created” the category, and it worked. But it still does not appear as expected.

I did a fresh Discourse install to test, set up both components:

![br%20a170a9ec422c](https://global.discourse-cdn.com/meta/original/3X/e/d/ed07a7bc954a203031186cad1c0b3fa860db3e3d.jpeg)

(D.I.Y. / `diy` is the category I want to enable KB for, and it has a specific top link created with [Custom top navigation links](https://meta.discourse.org/t/custom-top-navigation-links/87225) component)

![br%2086f9546a1534](https://global.discourse-cdn.com/meta/original/3X/3/e/3e4ea8a5da19f141cdbc5b55d66a7e2416cb5b93.jpeg)

But the D.I.Y. category appears with normal view:

 ![br%2065b61e8af9f3](https://global.discourse-cdn.com/meta/original/3X/0/f/0f5c1041ee35911b7ed8e278e226de85bdb75318.jpeg)

URL shows at the end: `/c/diy?kb=active`

---

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [August 19, 2019, 2:53pm UTC](https://meta.discourse.org/t/knowledge-base/121898/17 "2019-08-19T14:53:36Z")

</div>

> [@Sean\_R](#):
>
> How do you apply this to a subcategory? Is there a special syntax?

No special syntax - just enter the slug of the category (subcategory or not) in the `kb categories` theme setting, refresh your browser, and it should work.

> [@TowerBR](#):
>
> Thank you so much for this! We have a category in our community that would be perfect for applying this component, but we are facing an issue: categories don’t show up in the “kb categories” drop down so we can’t choose the category to apply the component. Any advice?

This is a limitation of theme settings right now – you’ll have to type in the slug as @Sean_R suggested.

> [@TowerBR](#):
>
> But it still does not appear as expected.

Did you get this sorted @TowerBR? Did you refresh after adding the category to the setting? Did you click the KB button? Sorry for the silly questions but trying to get to the bottom of it.

---

<div class="post-metadata">

### Author: ![Sean\_R](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sean_r/32/72433_2.png) [@Sean\_R](https://meta.discourse.org/u/Sean_R)
#### Post date: [August 19, 2019, 3:28pm UTC](https://meta.discourse.org/t/knowledge-base/121898/18 "2019-08-19T15:28:29Z")

</div>

> [@justin](#):
>
> No special syntax - just enter the slug of the category (subcategory or not) in the `kb categories` theme setting, refresh your browser, and it should work.

It worked thanks 🙂

I like it this way since I can name all of my KB subcategories the same and only need to add them once.

I do notice that if I go to the category by the dropdown that it does not automatically switch to the KB view.

All other ways to navigate appear to work but the sub-category drop-down does not.

---

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [August 19, 2019, 3:30pm UTC](https://meta.discourse.org/t/knowledge-base/121898/19 "2019-08-19T15:30:21Z")

</div>

> [@Sean\_R](#):
>
> I do notice that if I go to the category by the dropdown that it does not automatically switch to the KB view.

Do you have the `default to kb view` turned on? I just tested this on a site of mine and it did seem to work with subcategories.

---

<div class="post-metadata">

### Author: ![Sean\_R](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sean_r/32/72433_2.png) [@Sean\_R](https://meta.discourse.org/u/Sean_R)
#### Post date: [August 19, 2019, 3:38pm UTC](https://meta.discourse.org/t/knowledge-base/121898/20 "2019-08-19T15:38:55Z")

</div>

I do and it works most o the time just not if I use the sub-category drop-down to change categories from one to another category.

---

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [August 19, 2019, 4:01pm UTC](https://meta.discourse.org/t/knowledge-base/121898/21 "2019-08-19T16:01:37Z")

</div>

Odd - ok. If you can repro it consistently, let me know and I’ll take a look. I haven’t been able to get that behavior to fire using the subcategory dropdown.

---

<div class="post-metadata">

### Author: ![TowerBR](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/towerbr/32/152148_2.png) [@TowerBR](https://meta.discourse.org/u/TowerBR)
#### Post date: [August 19, 2019, 5:38pm UTC](https://meta.discourse.org/t/knowledge-base/121898/22 "2019-08-19T17:38:51Z")

</div>

> [@justin](#):
>
> This is a limitation of theme settings right now – you’ll have to type in the slug as @Sean_R suggested.

Yep, I had already done that, see the picture of the [post above](https://meta.discourse.org/t/knowledge-base-theme-component/121898/16):

![br%2086f9546a1534](https://global.discourse-cdn.com/meta/original/3X/3/e/3e4ea8a5da19f141cdbc5b55d66a7e2416cb5b93.jpeg)

I removed the “Custom top navigation links” component. It is now a completely “clean” installation:

![br%20346e44618d61](https://global.discourse-cdn.com/meta/original/3X/2/5/25460095eb7eeb6a66bb3ab348f9928c4e9ec9fc.jpeg)

> [@justin](#):
>
> Did you refresh after adding the category to the setting?

Yes, and I cleaned the cache.

> [@justin](#):
>
> Did you click the KB button?

Yes. When I select the category by main drop down it already loads the category page with `/c/diy?kb=active` at the end of the URL. When I hover the KB button, it shows the “normal” URL without this “add-on”, but when I click on it nothing happens.

---

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [August 19, 2019, 5:42pm UTC](https://meta.discourse.org/t/knowledge-base/121898/23 "2019-08-19T17:42:31Z")

</div>

Are you running on the latest version of the theme component? Are you running on `tests-passed` or `stable` for your Discourse version?

---

<div class="post-metadata">

### Author: ![Sean\_R](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sean_r/32/72433_2.png) [@Sean\_R](https://meta.discourse.org/u/Sean_R)
#### Post date: [August 19, 2019, 5:52pm UTC](https://meta.discourse.org/t/knowledge-base/121898/24 "2019-08-19T17:52:40Z")

</div>

It happens every time. I can just click “KB” or refresh fixes it but not when I go to the category from the drop-down.

---

<div class="post-metadata">

### Author: ![TowerBR](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/towerbr/32/152148_2.png) [@TowerBR](https://meta.discourse.org/u/TowerBR)
#### Post date: [August 19, 2019, 6:06pm UTC](https://meta.discourse.org/t/knowledge-base/121898/25 "2019-08-19T18:06:12Z")

</div>

> [@justin](#):
>
> Are you running on the latest version of the theme component?

Yes:

 ![br%20727aa12a3d7b](https://global.discourse-cdn.com/meta/original/3X/9/a/9a5d34c8ea42e9471590d1a1e5965f27066dc4d7.jpeg)

> [@justin](#):
>
> Are you running on `tests-passed` or `stable` for your Discourse version?

```
params:
   version: tests-passed

```

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [August 19, 2019, 9:29pm UTC](https://meta.discourse.org/t/knowledge-base/121898/26 "2019-08-19T21:29:20Z")

</div>

This is awesome! Just installed it to take a look, and I can see it is already very useful.

This theme component does seem to conflict with [https://meta.discourse.org/t/knowledge-base-plugin/115288](https://meta.discourse.org/t/knowledge-base-plugin/115288) by @angus. I can confirm that the plugin has to be uninstalled prior to enabling this theme component, otherwise the below happens when you look at a knowledge base category. Note the weird horizontal line next to the menu and spinning circle.

 ![37%20PM](https://global.discourse-cdn.com/meta/original/3X/c/6/c63a535b3c9ec5aa3e443844137cd0929c1ef4c3.png)

I’d love to hear some more about the advanced version and what you have planned. Some feedback:

- bug? when you select a tag from the left menu to filter by that tag, and then click to another category or latest etc.. then when you next click on kb to return to the knowledge base you will find you are still filtering by that tag.
- when you click on the tag under a title, it takes you to the tag page for that tag, not to a filtered kb view as it does when you click the tag on the left menu.
- click on the tag category title on the left menu, and you are taken to the latest view for the category. I’d suggest this not link to anywhere. The category title also should probably not have `#` which is a distraction.
- it would be handy to see the number of topics with each tag on the left menu
- it would be handy to be able to sort kb topics alphabetically or even in custom order

[Next page](https://meta.discourse.org/t/knowledge-base/121898.md?page=2)
