You are here

foundation-tabs.tpl.php in ZURB Section 7

Displays a Zurb Foundation style tab group.

Available variables:

  • $has_tabs: Boolean value for determining if there are tabs to print out.
  • $tab_row_classes: The classes set on the group from the formatter settings.
  • $tab_content_classes: The classes set on the tab.
  • $tab_parents: An array of tab parents (clickable tab headers).
  • $tab_children: An array of tab children (content of each tab).

File

templates/foundation-tabs.tpl.php
View source
<?php

/**
 * @file
 * Displays a Zurb Foundation style tab group.
 *
 * Available variables:
 * - $has_tabs: Boolean value for determining if there are tabs to print out.
 * - $tab_row_classes: The classes set on the group from the formatter settings.
 * - $tab_content_classes: The classes set on the tab.
 * - $tab_parents: An array of tab parents (clickable tab headers).
 * - $tab_children: An array of tab children (content of each tab).
 *
 * @ingroup themeable
 */
?>

<?php

if ($has_tabs) {
  ?>
  <dl class="tabs <?php

  if (isset($tab_row_classes)) {
    print $tab_row_classes;
  }
  ?>">
    <?php

  foreach ($tab_parents as $parent) {
    ?>
      <dd class="<?php

    if (isset($parent['class'])) {
      print $parent['class'];
    }
    ?>"><?php

    print $parent['title'];
    ?></dd>
    <?php

  }
  ?>
  </dl>

  <ul class="tabs-content <?php

  if (isset($tab_content_classes)) {
    print $tab_content_classes;
  }
  ?>">
    <?php

  foreach ($tab_children as $child) {
    ?>
      <li id="<?php

    print $child['id'];
    ?>" class="<?php

    if (isset($child['class'])) {
      print $child['class'];
    }
    ?>"><?php

    print $child['content'];
    ?></li>
    <?php

  }
  ?>
  </ul>
<?php

}