faq-category-new-page.tpl.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php
  2. /**
  3. * @file
  4. * Template file for the FAQ page if set to show the categorized answer in a
  5. * new page.
  6. */
  7. /**
  8. * Available variables:
  9. *
  10. * $display_header
  11. * Boolean value controlling whether a header should be displayed.
  12. * $header_title
  13. * The category title.
  14. * $category_depth
  15. * The term or category depth.
  16. * $description
  17. * The current page's description.
  18. * $term_image
  19. * The HTML for the category image. This is empty if the taxonomy image module
  20. * is not enabled or there is no image associated with the term.
  21. * $display_faq_count
  22. * Boolean value controlling whether or not the number of faqs in a category
  23. * should be displayed.
  24. * $question_count
  25. * The number of questions in category.
  26. * $question_list
  27. * An array of questions.
  28. * $question_list_style, either ol or ul
  29. * The style of the question list, either ol or ul (ordered or unordered).
  30. * $container_class
  31. * The class attribute of the element containing the sub-categories, either
  32. * 'faq-qa' or 'faq-qa-hide'. This is used by javascript to open/hide
  33. * a category's faqs.
  34. * $subcat_list
  35. * An array of sub-categories. Each sub-category stored in the $subcat_list
  36. * array has the following information:
  37. * $subcat['link'] is the link to the sub-category.
  38. * $subcat['description'] is the sub-category description.
  39. * $subcat['count'] is the number of questions in the sub-category.
  40. * $subcat['term_image'] is the sub-category (taxonomy) image.
  41. * $subcat_list_style
  42. * The style of the sub-category list, either ol or ul (ordered or unordered).
  43. * $subcat_body_list
  44. * The sub-categories faqs, recursively themed (by this template).
  45. */
  46. // @todo should be moved to better place.
  47. // @codingStandardsIgnoreStart
  48. if ($category_depth > 0) {
  49. $hdr = 'h4';
  50. }
  51. else {
  52. $hdr = 'h3';
  53. }
  54. // @codingStandardsIgnoreEnd
  55. ?><div class="faq-category-group">
  56. <!-- category header with title, link, image, description, and count of
  57. questions inside -->
  58. <div class="faq-qa-header">
  59. <?php if ($display_header): ?>
  60. <<?php print $hdr; ?> class="faq-header">
  61. <?php print $term_image; ?>
  62. <?php print $header_title; ?>
  63. <?php if ($display_faq_count): ?>
  64. (<?php print $question_count; ?>)
  65. <?php endif; ?>
  66. </<?php print $hdr; ?>>
  67. <?php else: ?>
  68. <?php print $term_image; ?>
  69. <?php endif; ?>
  70. <?php if (!empty($description)): ?>
  71. <div class="faq-qa-description"><?php print $description ?></div>
  72. <?php endif; ?>
  73. <?php if (!empty($term_image)): ?>
  74. <div class="clear-block"></div>
  75. <?php endif; ?>
  76. </div> <!-- Close div: faq-qa-header -->
  77. <!-- list subcategories, with title, link, description, count -->
  78. <?php if (!empty($subcat_list)): ?>
  79. <div class="item-list">
  80. <<?php print $subcat_list_style; ?> class="faq-category-list">
  81. <?php foreach ($subcat_list as $i => $subcat): ?>
  82. <li>
  83. <?php print $subcat['link']; ?>
  84. <?php if ($display_faq_count): ?>
  85. (<?php print $subcat['count']; ?>)
  86. <?php endif; ?>
  87. <?php if (!empty($subcat['description'])): ?>
  88. <div class="faq-qa-description"><?php print $subcat['description']; ?></div>
  89. <?php endif; ?>
  90. <div class="clear-block"></div>
  91. </li>
  92. <?php endforeach; ?>
  93. </<?php print $subcat_list_style; ?>>
  94. </div> <!-- Close div: item-list -->
  95. <?php endif; ?>
  96. <div class="<?php print $container_class; ?>">
  97. <!-- include subcategories -->
  98. <?php if (count($subcat_body_list)): ?>
  99. <?php foreach ($subcat_body_list as $i => $subcat_html): ?>
  100. <div class="faq-category-indent"><?php print $subcat_html; ?></div>
  101. <?php endforeach; ?>
  102. <?php endif; ?>
  103. <!-- list questions (in title link) and answers (in body) -->
  104. <?php if (!empty($question_list)): ?>
  105. <div class="item-list">
  106. <<?php print $question_list_style; ?> class="faq-category-list">
  107. <?php foreach ($question_list as $i => $question_link): ?>
  108. <li>
  109. <?php print $question_link; ?>
  110. </li>
  111. <?php endforeach; ?>
  112. </<?php print $question_list_style; ?>>
  113. </div> <!-- Close div: item-list -->
  114. <?php endif; ?>
  115. </div> <!-- Close div: faq-qa / faq-qa-hide -->
  116. </div> <!-- Close div: faq-category-group -->