Knowledge Articles Expandable /Collapsible text

bna311
Kilo Contributor

I am looking for a way to add expandable /collapsible text to Knowledge Articles. I am unable to use the HTML5 <details> tag as it does not work in IE. Has anyone found a way to do this without editing the kb_view UI page?

5 REPLIES 5

elemonnier
Tera Expert

I found an example you can use:

<div class="panel list-group">
    <a class="list-group-item" style="color: #646464 !important;" href="#a1" data-toggle="collapse" data-target="#a1">General IT Related changes</a>
    <div id="a1" class="collapse">
        <div class="list-group-item">
            <p>Content</p>
            <ul>
                <li>List Item 1</li>
                <li>List Item 2</li>
                <li>List Item 3</li>
            </ul>
        </div>
    </div>
</div>

Looks like you're not alone... https://community.servicenow.com/community?id=community_question&sys_id=b246f1c3dbc36b00656a5583ca96...

 

I thought I'd try a wiki text way but none of these seem to work either;

https://www.mediawiki.org/wiki/Manual:Collapsible_elements

On the knowledgebase field, add the attribute 'html_sanitize=false' and it will work. This will prevent the ServiceNow html editor from sanitizing and stripping off the html tags. This worked for us.

Let me know if this helps.

 

Kind Regards,

Pri

 

Hello, when you say "on the knowledgebase field" what do you mean by that? I'm new at ServiceNow and not very familiar with HTML. Thanks!