You are here

views-bootstrap-grid-plugin-style.tpl.php in Views Bootstrap 7.2

Same filename and directory in other branches
  1. 7.3 templates/grid/views-bootstrap-grid-plugin-style.tpl.php

views-bootstrap-grid-plugin-style.tpl.php Default simple view template to display Bootstrap Grids.

  • $columns contains rows grouped by columns.
  • $rows contains a nested array of rows. Each row contains an array of columns.
  • $column_type contains a number (default Bootstrap grid system column type).

File

templates/grid/views-bootstrap-grid-plugin-style.tpl.php
View source
<?php

/**
 * @file views-bootstrap-grid-plugin-style.tpl.php
 * Default simple view template to display Bootstrap Grids.
 *
 *
 * - $columns contains rows grouped by columns.
 * - $rows contains a nested array of rows. Each row contains an array of
 *   columns.
 * - $column_type contains a number (default Bootstrap grid system column type).
 *
 * @ingroup views_templates
 */
?>

<?php

if (!empty($title)) {
  ?>
  <h3><?php

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

}
?>

<div id="views-bootstrap-grid-<?php

print $id;
?>" class="<?php

print $classes;
?>">
  <?php

if ($options['alignment'] == 'horizontal') {
  ?>

    <?php

  foreach ($items as $row) {
    ?>
      <div class="row-fluid">
        <?php

    foreach ($row['content'] as $column) {
      ?>
          <div class="span<?php

      print $column_type;
      ?>">
            <?php

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

    }
    ?>
      </div>
    <?php

  }
  ?>

  <?php

}
else {
  ?>

    <div class="row-fluid">
      <?php

  foreach ($items as $column) {
    ?>
        <div class="span<?php

    print $column_type;
    ?>">
          <?php

    foreach ($column['content'] as $row) {
      ?>
            <?php

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

    }
    ?>
        </div>
      <?php

  }
  ?>
    </div>

  <?php

}
?>
</div>