You are here

faq-category-questions-top.tpl.php in Frequently Asked Questions 7.2

Template file for the questions section of the FAQ page if set to show categorized questions at the top of the page.

File

includes/faq-category-questions-top.tpl.php
View source
<?php

/**
 * @file
 * Template file for the questions section of the FAQ page if set to show
 * categorized questions at the top of the page.
 */

/**
 * Available variables:
 *
 * $display_header
 *   Boolean value controlling whether a header should be displayed.
 * $header_title
 *   The category title.
 * $category_name
 *   The name of the category.
 * $answer_category_name
 *   Whether the category name should be displayed with the answers.
 * $group_questions_top
 *   Whether the questions and answers should be grouped together.
 * $category_depth
 *   The term or category depth.
 * $description
 *   The current page's description.
 * $term_image
 *   The HTML for the category image. This is empty if the taxonomy image module
 *   is not enabled or there is no image associated with the term.
 * $display_faq_count
 *   Boolean value controlling whether or not the number of faqs in a category
 *   should be displayed.
 * $question_count
 *   The number of questions in category.
 * $nodes
 *   An array of nodes to be displayed.
 *   Each node stored in the $nodes array has 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
 *   Whether $node['body'] contains the full body or just the teaser text.
 * $container_class
 *   The class attribute of the element containing the sub-categories, either
 *   'faq-qa' or 'faq-qa-hide'. This is used by javascript to open/hide
 *   a category's faqs.
 * $question_list
 *   An array of question links.
 * $question_list_style
 *   The style of the question list, ul for unordered, ol for ordered.
 * $subcat_list
 *   An array of sub-categories.  Each sub-category stored in the $subcat_list
 *   array has the following information:
 *     $subcat['link'] is the link to the sub-category.
 *     $subcat['description'] is the sub-category description.
 *     $subcat['count'] is the number of questions in the sub-category.
 *     $subcat['term_image'] is the sub-category (taxonomy) image.
 * $subcat_list_style
 *   The style of the sub-category list, either ol or ul (ordered or unordered).
 * $subcat_body_list
 *   The sub-categories faqs, recursively themed (by this template).
 */
if ($category_depth > 0) {
  $hdr = 'h4';
}
else {
  $hdr = 'h3';
}
?>
<a id="faq-top"></a>
<div class="faq-category-menu">
  <div class="faq-qa-header">
  <?php

if ($display_header) {
  ?>
    <<?php

  print $hdr;
  ?> class="faq-header">
    <?php

  print $term_image;
  ?>
    <?php

  print $header_title;
  ?>
    <?php

  if ($display_faq_count) {
    ?>
      (<?php

    print $question_count;
    ?>)
    <?php

  }
  ?>
    </<?php

  print $hdr;
  ?>>
  <?php

}
else {
  ?>
    <?php

  print $term_image;
  ?>
  <?php

}
?>
  <?php

if (!empty($description)) {
  ?>
    <div class="faq-qa-description"><?php

  print $description;
  ?></div>
  <?php

}
?>
  <?php

if (!empty($term_image)) {
  ?>
    <div class="clear-block"></div>
  <?php

}
?>
  </div>

  <?php

if (!empty($subcat_list)) {
  ?>
    <div class="item-list">
    <<?php

  print $subcat_list_style;
  ?> class="faq-category-list">
    <?php

  foreach ($subcat_list as $i => $subcat) {
    ?>
      <li>
      <?php

    print $subcat['link'];
    ?>
      <?php

    if ($display_faq_count) {
      ?>
        (<?php

      print $subcat['count'];
      ?>)
      <?php

    }
    ?>
      <?php

    if (!empty($subcat['description'])) {
      ?>
      <div class="faq-qa-description"><?php

      print $subcat['description'];
      ?></div>
      <?php

    }
    ?>
      <div class="clear-block"></div>
      </li>
    <?php

  }
  ?>
    </<?php

  print $subcat_list_style;
  ?>>
  </div>
  <?php

}
?>

  <div class="<?php

print $container_class;
?>">

  <?php

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

  foreach ($subcat_body_list as $i => $subcat_html) {
    ?>
      <div class="faq-category-indent"><?php

    print $subcat_html;
    ?></div>
    <?php

  }
  ?>
  <?php

}
?>

  <?php

if (!empty($question_list)) {
  ?>
    <div class="item-list">
    <<?php

  print $question_list_style;
  ?> class="faq-ul-questions-top">
    <?php

  foreach ($question_list as $i => $question_link) {
    ?>
      <li>
      <?php

    print $question_link;
    ?>
      </li>
    <?php

  }
  ?>
    </<?php

  print $question_list_style;
  ?>>
  </div>
  <?php

}
?>

  <?php

if (!$group_questions_top && $category_display != 'hide_qa') {
  ?>
    </div>
    </div>
  <?php

}
?>

  <?php

if ($answer_category_name) {
  ?>
    <<?php

  print $hdr;
  ?> class="faq-header">
    <?php

  print $term_image;
  ?>
    <?php

  print $category_name;
  ?>
    </<?php

  print $hdr;
  ?>>
    <div class="clear-block"></div>
  <?php

}
?>

  <div class="faq-category-group">
  <div>

  <?php

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

  foreach ($nodes as $i => $node) {
    ?>

      <div class="faq-question">
        <?php

    if (!empty($question_label)) {
      ?>
          <strong class="faq-question-label">
            <?php

      print $question_label;
      ?>
          </strong>
        <?php

    }
    ?>
      <?php

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

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

    if (!empty($answer_label)) {
      ?>
          <strong class="faq-answer-label">
            <?php

      print $answer_label;
      ?>
          </strong>
        <?php

    }
    ?>
        <?php

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

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

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

    }
    ?>
      </div>
    <?php

  }
  ?>
  <?php

}
?>

  </div>
</div>

<?php

if ($group_questions_top || $category_display == 'hide_qa') {
  ?>
</div>
</div>
<?php

}