Saturday 15 August 2015

Drupal 7 Views - Add a wrapper around rows for unformatted list from admin panel -



Drupal 7 Views - Add a wrapper around rows for unformatted list from admin panel -

i have views rendered html this

<div class="content"> <div class="row-1">some text here</div> <div class="row-2">some text here</div> <div class="row-3">some text here</div> </div>

now want wrap rows using wrapper div so.

<div class="content"> <div class="wrapper-1"> <div class="row-1">some text here</div> <div class="row-2">some text here</div> <div class="row-3">some text here</div> </div> </div>

use style output template of views/display. find in "theming information". views/display do:

advanced > theme: information

the first template "views-view-unformatted.tpl.php" can utilize in list.

the original code is:

<?php if (!empty($title)): ?> <h3><?php print $title; ?></h3> <?php endif; ?> <?php foreach ($rows $id => $row): ?> <div<?php if ($classes_array[$id]) { print ' class="' . $classes_array[$id] .'"'; } ?>> <?php print $row; ?> </div> <?php endforeach; ?>

add wrapper around foreach , done.

drupal drupal-7 drupal-views

No comments:

Post a Comment