Skip to main content
Question

Link to a subheading in a KB article

  • 17 July 2024
  • 5 replies
  • 61 views

Does anyone know of a way to add a link to a subheading in an article in the knowledge base? Rather than direct the user to the top of the page, I’d like to use a URL to direct them to a subheading on a page. This is for the CC - Customer Community product.

Thanks in advance for any tips!

5 replies

Userlevel 7
Badge +5

Hi @ljaynes 

Moving this discussion to our CC product category.

Userlevel 6
Badge +4

Hey @ljaynes - the easiest way to do that is to use the native Table of contents feature in the article editor.  All you need to do is format your sections with a Small heading or Large heading and then add the Table of contents.  If you want one of those links to be used somewhere else, you should be able to simply copy the link from there.  

Thanks, @revathimenon for moving my question and @Kenneth R for your suggestion.

I should have been more clear in my query. The TOC works great if you’re linking to the page that includes the TOC.

Say I have Large headings and Small headings on page one. I want to link to one of the Small headings page two, which is another page. Is that possible?

Userlevel 6
Badge +4

Hi @ljaynes - sorry for the late reply!  I was doing some testing and ran into some unrelated technical issues.  :) 

The good news is that I believe I’ve been able to achieve what you are looking for.  I wasn’t sure if it would work, as it requires manually editing the HTML of the posts, which doesn’t always work as custom coding can get stripped out, but this does work:

  1. I created an article with enough replies to get me to the second page.
  2. In one of the posts on the second page, I selected a heading and made it a ‘Small heading’.  
  3. I then clicked into the HTML editor in Control and added an anchor ID manually.  In my test it became:
    <h3 id="test_anchor">Big wall of text</h3>
  4. I then created a link - which is the page link to the second page of that article, with ‘#test_anchor’ at the end of the URL.  You won’t have access to this, as it links to a private test category, but the link in my case looks like this: 
    https://communities.gainsight.com/for-testing-only-292/test-25017/index2.html#test_anchor
Hope this helps!

@Kenneth R , thanks for your response!
I will try what you’ve suggested.

I didn’t phrase my question correctly. What I’d like to do is add a link to a small heading in one article on a different article.

So, I have article #1 with say 3 large headings and 7 small headings. And I have article #2 where I want to add a link to 1 of the 7 small headings in article #1.

Reply