You are here

uikit-view-accordion.tpl.php in UIkit Components 7.3

Same filename and directory in other branches
  1. 7.2 uikit_views/templates/uikit-view-accordion.tpl.php

Template to display a view as a UIkit Grid component.

  • $title: The title of this group of rows. May be empty.
  • $rows: An array of row items.
  • $attributes: The attributes to apply to the list wrapper.
  • $grid_classes: The classes to apply to the list element.

File

uikit_views/templates/uikit-view-accordion.tpl.php
View source
<?php

/**
 * @file
 * Template to display a view as a UIkit Grid component.
 *
 * - $title: The title of this group of rows.  May be empty.
 * - $rows: An array of row items.
 * - $attributes: The attributes to apply to the list wrapper.
 * - $grid_classes: The classes to apply to the list element.
 *
 * @see template_preprocess_uikit_view_grid()
 * @see template_process_uikit_view_grid()
 *
 * @ingroup uikit_views_templates
 */
if (!empty($title)) {
  ?>
  <h3><?php

  print $title;
  ?></h3>
<?php

}
?>

<ul<?php

print $accordion_attributes;
?>>
  <?php

foreach ($items as $id => $row) {
  ?>
    <li>
      <h3 class="uk-accordion-title"><?php

  print $row['title'];
  ?></h3>
      <div class="uk-accordion-content"><?php

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

}
?>
</ul>