faq-questions-top.tpl.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * @file
  4. * Template file for the FAQ page if set to show the questions in a list at the
  5. * top.
  6. */
  7. /**
  8. * Available variables:
  9. *
  10. * $questions_list
  11. * Pre-formatted list of questions.
  12. * $questions
  13. * An array of questions to use for producing the question list at the top.
  14. * $answers
  15. * An array of answers to use for producing the main body of text.
  16. * $answers[$key]['question'] is the question text.
  17. * $answers[$key]['body'] is the answer text.
  18. * $answers[$key]['links'] represents the node links, e.g. "Read more".
  19. * $use_teaser
  20. * Is true if $answer['body'] is a teaser.
  21. * $list_style
  22. * Represents the style of list, ul for unordered, ol for ordered.
  23. * $question_label
  24. * The question label, intended to be pre-pended to the question text.
  25. * $answer_label
  26. * The answer label, intended to be pre-pended to the answer text.
  27. * $limit
  28. * Represents the number of items.
  29. */
  30. ?>
  31. <a id="faq-top"></a>
  32. <?php print $questions_list ?>
  33. <br />
  34. <?php $key = 0; ?>
  35. <?php while ($key < $limit): ?>
  36. <?php /* Cycle through all the answers and "more" links. $key will represent the applicable position in the arrays. */ ?>
  37. <div class="faq-question">
  38. <?php if (!empty($question_label)): ?>
  39. <strong class="faq-question-label">
  40. <?php print $question_label; ?>
  41. </strong>
  42. <?php endif; ?>
  43. <?php print $answers[$key]['question']; ?>
  44. </div> <!-- Close div: faq-question -->
  45. <div class="faq-answer">
  46. <?php if (!empty($answer_label)): ?>
  47. <strong class="faq-answer-label">
  48. <?php print $answer_label; ?>
  49. </strong>
  50. <?php endif; ?>
  51. <?php print $answers[$key]['body']; ?>
  52. <?php print $answers[$key]['links']; ?>
  53. </div> <!-- Close div: faq-answer -->
  54. <?php /* Increment $key to move on to the next position. */ ?>
  55. <?php $key++; ?>
  56. <?php endwhile; ?>