views:

39

answers:

4

I need to add FAQ list to a page, and I would like to expand / collapse the answers when a question in the list is clicked.

Could you suggest any Drupal module for doing this ?

If I'm not wrong, the FAQ module (http://drupal.org/project/faq) doesn't include this feature (expanding/collapsing).

thanks

A: 

Something like this, is most easily done in your theme. All you really need is a few lines of css and JavaScript. I doubt you will find any module that does this, since it will be very hard to make generic and user friendly while it's very easy to make it customized in your theme.

googletorp
A: 

Have you considered using jQuery UI Accordion? You can just write out your FAQ as a standard list and apply the accordion effect to it in your theme.

Mark B
A: 

Create a FAQ content type with title and description. Make a node-faq.tpl file in themes with following content.

<div id="accordion">
<h3><a href="#"><?php print $node->title ?><a></h3>
<div><?php print $node->content ?></div>
</div>

Make a javascript file acc.js with following content and add it into the theme folder.

jQuery(document).ready(function() {
  $('.accordion.head').click(function() {
    $(this).next().toggle();
    return false;
  }).next().hide();
});

Or animated:

jQuery(document).ready(function(){
  $('.accordion.head').click(function() {
    $(this).next().toggle('slow');
    return false;
  }).next().hide();
});

Include this file in theme.info

scripts[] = acc.js
Loveleen Kaur
A: 

I've actually seen there is this option in FAQ module. In the description on Drupal website it was not clear...

Patrick

related questions