Skip to main content

Hello.

I’m wondering if there is any way to add a navigation menu to our knowledge base. When reading an article, the left pane shows “Related Articles” but if we wanted them to be read and followed in a specific order, it’d be much more helpful to have the entire Solution tree as something that can be made expandable. Sounds like basic functionality, but I can’t find how to make it work.

Something like:

  • Category A
    • Folder 1 (expandable)
    • Folder 2 (expandable)
    • Folder 3 (expandable)
  • Category B
    • Folder 1 (expandable)
    • Folder 2 (expandable)
  • Category C
    • Folder 1 (expandable)

There wouldn’t be a need to always go back home. I know we can directly link from one article to another but that’s not what I’m looking for. 

Any help will be appreciated.

Thank you.

Hi, 

Would something like this be of interest to you, then:

 


??

Here you have expand/collapse on each article, and the different folders on the right.

I know this can be arranged with portal customization, i.e. adding HTML/CSS/Javascript code.
 


Thanks @evlo96

Yes, something like that would be great. Is there any sample code that freshworks has provided for this?


No problem, @Danielch
 

Thanks @evlo96

Is there any sample code that freshworks has provided for this?

 

Not that I have found, unfortunately. My company is in the process of hiring 3rd party to customize the FAQ section, among other things.


We have just recently launched our own portal on Freshdesk and created the sidebar navigation.

 

 

It expands, and also expands when you link directly the solution.

https://support.inlinemanual.com/support/solutions/articles/80000983302-how-to-announce-new-features

 

We are not using Categories yet, just folders, but it can be, I would say, easily re-used if you have some basic knowledge of HTML/JS.

 

I can share the code with you if you want to give it a try.


@msotak could you share that code here? I’d like to see it too. Thanks


@msotak can you please share your HTML for your knowledge base?


@msotak could you share that code here? I’d like to see it too. Thanks

@msotak can you please share your HTML for your knowledge base?

Here you go: https://gist.github.com/mareksotak/86296e561ff75a30accac332175b543c

Let me know if you have implemented it. :)


FWIW, here is an extended version of @msotak Folders > Articles but also for Categories (kudos @msotak). 

It simply covers navigating the Liquid object hierarchy to display a nested list of Categories > Folders > Articles.  Style at your leisure.  I removed the links for the Category > Folder > Article you are currently in.

Ps This will only work up to and including Pro.  Enterprise has additional nested folders

{% for category in {{portal.solution_categories}} %}                       
{% if article.category.id == category.id %}
{{category.name}}
<ul>
{% for folder in article.category.folders %}
{% if article.folder.id == folder.id %}
{{folder.name}}
<ul>
{% for articlen in folder.articles %}
{% if article.id == articlen.id %}
{{articlen.title}}
{% else %}
<a href="{{articlen.url}}">{{articlen.title}}</a>
{% endif %}
{% endfor %}
</ul>
{% else %}
<a href="{{folder.url}}">{{folder.name}}</a>
{% endif %}
{% endfor %}
</ul>
{% else %}
<a href="{{category.url}}">{{category.name}}</a>
{% endif %}
{% endfor %}

 

 

 


Here is an exploded list and thus simplified version

{% for category in {{portal.solution_categories}} %}
<a href="{{category.url}}">{{category.name}}</a>
<ul>
{% for folder in category.folders %}
<a href="{{folder.url}}">{{folder.name}}</a>
<ul>
{% for article in folder.articles %}
<a href="{{article.url}}">{{article.title}}</a>
{% endfor %}
</ul>
{% endfor %}
</ul>
{% endfor %}

 


Well done. :)


Reply