How to add expand/collapse icon in html?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2014 05:21 AM
Hi,
In Knowledge Management, while creating an article when I change the article type corresponding template will appear inside the text field. In every template there will be a heading and description below that. For each heading of the article, I need to add expand/collapse icon at the right end so that I can expand/collapse the description below the title. Can anyone help me in doing this in HTML ?
Regards,
Hema P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2015 10:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2015 12:30 PM
Hi Jyothikala,
When you click back on the "Please click here" to close it, does it not close? It has been working for me in Firefox and Chrome using the code in the HTML editor, but it is a very manual process. Making changes in the text editor doesn't always work.
On the article creation page, it doesn't collapse at all?
N
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2015 10:57 PM
Hi All,
This can be achieved with below UI Script & HTML snippet. The only thing is you'll have to paste below HTML snippet in TinyMCE Editor using HTML Mode.
HTML Snippet:
<fieldset class="expandCollapseBlock"><legend style="font-size: 12px;"> [+/-] First Block Heading Here</legend>
<div class="dataContent">
<ul>
<li>Item One</li>
<li>Item Two</li>
<li>Item Three</li>
</ul>
</div>
</fieldset>
<p> </p>
<fieldset class="expandCollapseBlock"><legend style="font-size: 12px;"> [+/-] Second Block Heading Here</legend>
<div class="dataContent">
<ul>
<li>Item One</li>
<li>Item Two</li>
<li>Item Three</li>
</ul>
</div>
</fieldset>
UI Script:
$j(document).ready(function(){
var myEC = $j('fieldset.expandCollapseBlock');
if (myEC.length){
console.log('expandCollapseBlock was here!!!!!!!');
$j('fieldset.expandCollapseBlock').click(function(){
$j(this).find('div.dataContent').toggle();
});
}
});
Your KB Article in TinyMCE would be look something like this:
And your end result would be :
Now when you click anywhere on content, it would expand and collapse the content.
Hope this help!
-Manjul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2015 10:26 AM
Thank you, Manjul! I appreciate the help!
Norma
Best wishes,
Norma Ohlenbusch
On Sun, Nov 22, 2015 at 12:57 AM, manjul.katare <
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2015 10:44 AM
You are more than welcome Norma, I'm glad I was able to help.
If you are satisfied with an answer please mark this thread as Helpful.
-Manjul
