Introduction
Just keep reading this tutorial which will teach how to create a fancy FAQ with an expandable/collapsible feature in an easier approach.
In short, creating a fancy FAQ section can be easily achieved in Magento by using CMS page & jQuery.
Steps
Go to Admin > CMS Pages > Add New Page and implement the following steps:
1. Add FAQ contents
Add the following content in the ‘Content’ > ‘Content’ section of CMS page:
<div class="expand_wrapper">
<h2 class="expand_heading"><a href="#">1. WordPress Theme Development</a></h2>
<div class="toggle_container">
<div class="box">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p>
</div>
</div>
<h2 class="expand_heading"><a href="#">2. Magento E-commerce</a></h2>
<div class="toggle_container">
<div class="box">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p>
<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p>
</div>
</div>
<h2 class="expand_heading"><a href="#">3. Website Development</a></h2>
<div class="toggle_container">
<div class="box">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p>
<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p>
</div>
</div>
<h2 class="expand_heading"><a href="#">4. PHP MySql Development</a></h2>
<div class="toggle_container">
<div class="box">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p>
<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p>
</div>
</div>
</div>
2. Inject jQuery code
Add the following XML code in ‘Design’ > ‘Layout Update XML’ field of CMS page:
<reference name="head">
<block type="core/text" name="google.cdn.jquery">
<action method="setText">
<text><![CDATA[
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">jQuery.noConflict();</script>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery(".toggle_container").slice(1).hide();//expands first FAQ content
jQuery(".expand_heading:first").addClass("active");//add active class to first FAQ title
jQuery("h2.expand_heading").click(function(event){
event.preventDefault()
jQuery(this).toggleClass("active");
jQuery(this).next(".toggle_container").slideToggle("slow");
});
});
</script>
]]></text>
</action>
</block>
</reference>
3. You’re done
Go to the frontend and open the FAQ page, you will see as:

Happy E-Commerce!
you guys give some great tips 🙂
Great!! how to make the first question “not expand “?
Find the following lines in ‘Layout Update XML’:
jQuery(".toggle_container").slice(1).hide();//expands first FAQ contentjQuery(".expand_heading:first").addClass("active");//add active class to first FAQ title
and replace by:
jQuery(".toggle_container").hide();//expands first FAQ contentCheers!
I’ve already taken your example and implemented it, thank you!
Can you do this with a list?
I have used the first example and it was very much successful…Thank you
How do we hide hide an open question when opening a new one?
I dd everything you mentioned to my site but it does not work. Is it cause im using my own theme and not the default? I have a special static block for footer is this a problem? How will this code link to my FAQ footer if you dont mention where its supposed to link to?
Looking to add FAQ’s on product page and wondering if this can be modified to do that?
I am sure that the informative you shared through your post is useful for people. I am impressed with the way of writing. It kept connected me all the time.Keep up the good work. Convert html to wordpress theme online free
I read your article and I like your post I think that is very useful information to me I’ll follow your tips. online hotel booking in goa
This code works, but is causing an additional menu like on the mobile site. Believe the jquery is triggering mobile site menu
Sorry I know this is an old post, but I was wondering if anyone knows how to incorporate a “Collapse All” button into this design. Thank you so much!
I did this on a CMS page and it looks great. Can it be done in a “static block” ? I ask as there doesn’t seem to be an XML field. ?
Can this also be accomplished on category pages? Our content is at the top of the page. I would like to write 300 words or so for each category, but all that copy pushes the products down below the fold. Thanks!
Hi, this is an old discussion but wondering what the code would be to do a sub menu drop down.
For example
FRUIT – would expand to APPLES, BANANAS etc and then APPLES and BANANAS would expand separately again to show a description….