You are here

faq-hide-answer.tpl.php in Frequently Asked Questions 7.2

Same filename and directory in other branches
  1. 6 includes/faq-hide-answer.tpl.php
  2. 7 includes/faq-hide-answer.tpl.php

Template file for the FAQ page if set to show/hide the answers when the question is clicked.

File

includes/faq-hide-answer.tpl.php
View source
<?php

/**
 * @file
 * Template file for the FAQ page if set to show/hide the answers when the
 * question is clicked.
 */

/**
 * Available variables:
 *
 * $nodes
 *   The array of nodes to be displayed.
 *   Each $node array contains the following information:
 *     $node['question'] is the question text.
 *     $node['body'] is the answer text.
 *     $node['links'] represents the node links, e.g. "Read more".
 * $use_teaser
 *   Is true if $node['body'] is a teaser.
 */
?><div>
<?php

if (count($nodes)) {
  ?>
  <?php

  foreach ($nodes as $node) {
    ?>
    <div class="faq-question-answer">
    <div class="faq-question faq-dt-hide-answer">
    <?php

    print $node['question'];
    ?>
    </div>

    <div class="faq-answer faq-dd-hide-answer">
    <?php

    print $node['body'];
    ?>
    <?php

    if (isset($node['links'])) {
      ?>
      <?php

      print $node['links'];
      ?>
    <?php

    }
    ?>
    </div>
    </div>
  <?php

  }
}
?>
</div>