Adding javascript content to KB articles to add the button in KB article

Ganesh37
Kilo Contributor

I want to add the next button control in KB article where end user can read the topic /section 1 in KB and then click on next (button or link)to view the next section of KB article.( all this is within single KB article)

However I am unable to do so as the Article body ignores the javascript and only supports the HTML content.Is there any alternative way or plugin that we can use to achieve this.

Please advise.

Thanks in advance.

1 ACCEPTED SOLUTION

Paul Curwen
Giga Sage

Hi Ganesh,

 

You cannot use JavaScript directly in the body of a KB Article. 

 

You can however put a button in the KB Artile body using the below example. Just paste it into the HTML view where you want the button to appear. : 

 

<p>&nbsp;</p>

<table>

<tbody>

<tr>

<td style="background: #9FA900; font-size: 16px; padding: 10px; display: block; -moz-border-radius: 7px; -webkit-border-radius: 6px;"><a style="color: #fff;" href="your url" target="_top">Create Request</a></td>

</tr>

</tbody>

</table>

<p>&nbsp;</p>

 

This would look like:

 

find_real_file.png

 

To insert a link to a position on a KB Article you can use:

 

<a name="terms_and_conditions"></a>

 

Then embed links to these targets with:

 

<a href="#terms_and_conditions">Terms and Conditions can be found here</a>

 

Hope that helps.

 

Regards

 

Paul

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul

View solution in original post

3 REPLIES 3

Paul Curwen
Giga Sage

Hi Ganesh,

 

You cannot use JavaScript directly in the body of a KB Article. 

 

You can however put a button in the KB Artile body using the below example. Just paste it into the HTML view where you want the button to appear. : 

 

<p>&nbsp;</p>

<table>

<tbody>

<tr>

<td style="background: #9FA900; font-size: 16px; padding: 10px; display: block; -moz-border-radius: 7px; -webkit-border-radius: 6px;"><a style="color: #fff;" href="your url" target="_top">Create Request</a></td>

</tr>

</tbody>

</table>

<p>&nbsp;</p>

 

This would look like:

 

find_real_file.png

 

To insert a link to a position on a KB Article you can use:

 

<a name="terms_and_conditions"></a>

 

Then embed links to these targets with:

 

<a href="#terms_and_conditions">Terms and Conditions can be found here</a>

 

Hope that helps.

 

Regards

 

Paul

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul

Mani Raj
Tera Contributor

Hi @Paul Curwen

I have same kind of problem, I am trying to add accordion to a KB article. But It is not working. I also tried to add custom script but did not help. 

Can you help with me a solution?

 

Thanks in advance.

DAlonso
Tera Contributor

I used details tag so I can accomplish the accordion without scripting. You can also add styling to the summary tag inside details to give it the full experience.

Here's a reference to help:

Creating Accordions with just HTML and CSS (openreplay.com)