The Frequently Asked Questions (faq) module allows users with the 'administer faq' permission to create question and answer pairs which they want displayed on the 'faq' page. The 'faq' page is automatically generated from the FAQ nodes configured and the layout of this page can be modified on the settings page. Users will need the 'view faq' permission to view the 'faq page' page.
There are 3 blocks included in this module, one shows a list of FAQ categories while the others can show a configurable number of recent or random FAQs added.
Note the function theme_faq_highlights(), which shows the last X recently created FAQs, used by one of the blocks, can also be called in a php-filtered node if desired.
Once the module is activated, you can create your question and answer pairs by creating FAQ nodes (Create content >> FAQ). This allows you to edit the question and answer text. In addition, if the 'Taxonomy' module is enabled and there are some terms configured for the FAQ node type, it will also be possible to put the questions into different categories when editing.
The ability to configure the layout of the FAQ page is only possible in the Drupal 5.x and later versions of the module. There are four question and answer layouts to choose from. The 'administer faq' permission is needed for configuring the 'faq' page layout and editing of FAQ nodes.
You can also view the FAQ Module Preview article which offers a step by step configuration guide with screenshots and an inside look at the module
Including FAQ content in other nodes
In 5.x and 6.x versions, it is also possible to include the 'faq' page content in other nodes, for example, at the end of an article. To include the full 'faq' page content, just add the following PHP code to your node body. It works for both categorized and uncategorized faq nodes.
$faq_output = faq_page();
In addition, if you just want to include faq nodes from within just one category (e.g. term id = 123), you can do:
$faq_output = faq_page(123);
If displaying FAQs for a particular category, then the category name will not be displayed. this is by design and is often the desired behaviour if embedding the FAQ content in another page. If you wish to display the category name, you can do the following (add HTML tags as desired):
$tid = 123;
$term = taxonomy_get_term($tid);
6.x and 7.x specific features
In Drupal 6 and 7, if you wish to choose a different question layout than the default one configured, you can do:
print faq_page(NULL, 'questions_top');
print faq_page(123, 'questions_inline', 'categories_inline');
So the first param is the term id (if categories are in use), the second param is the question layout and the final one is the category layout.
The list of possible question layouts is:
- questions_inline : Questions inline
- questions_top : Clicking on question takes user to answer further down the page
- hide_answer : Clicking on question opens/hides answer under question
- new_page : Clicking on question opens the answer in a new page
The list of possible category layouts is:
- none : Don't display
- categories_inline : Categories inline
- hide_qa : Clicking on category opens/hides questions and answers under category
- new_page : Clicking on category opens the questions/answers in a new page
In each instance, you will need to choose the "PHP code" input filter format.
Uninstalling FAQ Module
- Disable the module on the Administer >> Site Building >> Modules Page
- Uninstall the module on the Administer >> Site Building >> Modules >> Uninstall tab
Stella Power (http://drupal.org/user/66894)