faq-hide-answer.tpl.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * @file
  4. * Template file for the FAQ page if set to show/hide the answers when the
  5. * question is clicked.
  6. */
  7. /**
  8. * Available variables:
  9. *
  10. * $nodes
  11. * The array of nodes to be displayed.
  12. * Each $node array contains the following information:
  13. * $node['question'] is the question text.
  14. * $node['body'] is the answer text.
  15. * $node['links'] represents the node links, e.g. "Read more".
  16. * $use_teaser
  17. * Is true if $node['body'] is a teaser.
  18. */
  19. ?><div>
  20. <?php if (count($nodes)): ?>
  21. <?php foreach ($nodes as $node): ?>
  22. <?php /* Cycle through each of the nodes. We now have the variable $node to work with. */ ?>
  23. <div class="faq-question-answer">
  24. <div class="faq-question faq-dt-hide-answer">
  25. <?php print $node['question']; ?>
  26. </div> <!-- Close div: faq-question faq-dt-hide-answer -->
  27. <div class="faq-answer faq-dd-hide-answer">
  28. <?php print $node['body']; ?>
  29. <?php if (isset($node['links'])): ?>
  30. <?php print $node['links']; ?>
  31. <?php endif; ?>
  32. </div> <!-- Close div: faq-answer faq-dd-hide-answer -->
  33. </div> <!-- Close div: faq-question-answer -->
  34. <?php endforeach; ?>
  35. <?php endif; ?>
  36. </div> <!-- Close div -->