Advanced Knowledge Base Widget Installation
The UserDeck Knowledge Base widget can be customized through an advanced installation. This approach gives you full control over the look and behavior of the widget—perfect for integrating with single-page applications (SPAs) such as React.js or Vue.js.
The advanced installation differs from the basic one by removing the data-userdeck-guides
attribute, which prevents automatic loading and allows you to initialize it manually.
Step-by-Step: Advanced Installation
Copy the modified code snippet into your website. It should look like this:
html
CopyEdit
<!-- Example installation snippet goes here -->
Make sure to replace the widget key with your own.
The anchor element is only necessary for SEO purposes (to allow search engines to index your content). If SEO is not a concern, you may simply create an empty <div>
with the corresponding id
where the widget should be injected.
Widget Options
Below is a breakdown of the key configuration options:
NameTypeDescriptionkeystring
Required. Your account's Knowledge Base widget key.elmixed
(selector)Required. A jQuery selector for the container element.layoutstring
Layout type: 'leftnav'
(default) or 'main'
.themestring
or false
Use 'default'
for the full theme, or false
for layout-only styling.collection_idint
Start on a specific collection page.category_idint
Start on a category page (requires collection_id
).article_idint
Start on a specific article page (requires collection_id
).settingsobject
Used to define advanced widget settings (see below).
Advanced Settings
You can customize various page views and shared components using the settings
object.
Home Page Settings
Object Path: settings.home
NameTypeDescriptioncollectionslist.numint
Number of collections to show; false
shows all.collectionslist.categorieslist.numint
Number of categories per collection.collectionslist.categorieslist.show_emptybool
Show empty categories if true
.collectionslist.categorieslist.linkbool
Make entire category clickable if true
.collectionslist.categorieslist.num_articlesbool
Show article count beside each category.collectionslist.categorieslist.articleslist.numint
Number of articles per category.
Collection Page Settings
Object Path: settings.collections
NameTypeDescriptionbodystring'articleslist'
to show articles, else categories shown.categorieslist.numint
Number of categories to display.categorieslist.show_emptybool
Show empty categories if true
.categorieslist.linkbool
Make categories clickable.categorieslist.num_articlesbool
Show number of articles in each category.categorieslist.articleslist.numint
Number of articles per category.articleslist.numint
Total articles to display.
Category Page Settings
Object Path: settings.categories
NameTypeDescriptionarticleslist.numint
Number of articles to show.
Article Page Settings
Object Path: settings.articles
NameTypeDescriptionarticleview.relatedbool
Show related articles if true
.
Breadcrumbs Settings
Object Path: settings.breadcrumbs
NameTypeDescriptionvisiblebool
Show breadcrumb navigation if true
.
Sidenav Settings
Object Path: settings.sidenav
NameTypeDescriptionvisiblebool
Display side navigation menu if true
.expandstring'active'
, 'none'
, or 'all'
depending on expansion behavior.