I have buttons below a slideshow I have created. I want them to be centered whether there be 1, 2, etc. I'm looking to have a wrapper div surrounding them with a class name of "button-count-x" (x being number of buttons). I've tried using a 'foreach' loop and counting the number of $row's, but that is not working.
Note: I am using the "Views Slideshow" module and am using the view's respective 'views-view.tpl.php' file.
<?php $count = 0; ?> <?php foreach ($fields as $id => $field): ?> <?php if (!empty($field->separator)): ?> <?php $count ++; ?> <?php print $field->separator; ?>
<div class = "test"><?php print $count; ?></div> <?php print $field->wrapper_prefix; ?> <?php print $field->label_html; ?> <?php print $field->content; ?> <?php print $field->wrapper_suffix; ?> <?php endforeach; ?>