Hello,
I have a view set up using Semantic Views that uses a style output (semanticviews-view-unformatted...tpl.php) template file to wrap all the rows of the view in a div for layout purposes (using flexbox CSS). Also in that template file, I have a pair of divs that print above the rows, acting as a header:
...
<div class="flex-row">
<?php if (!empty($row_element)): ?>
<div class="flex-half align-center text-uppercase"><h3>Before</h3></div>
<div class="flex-half align-center text-uppercase"><h3>After</h3></div>
<?php endif; ?>
<?php foreach ($rows as $id => $row): ?>
<?php if (!empty($row_element)): ?>
<<?php print $row_element; ?><?php print drupal_attributes($row_attributes[$id]); ?>>
<?php endif; ?>
<?php print $row; ?>
<?php if (!empty($row_element)): ?>
</<?php print $row_element; ?>>
<?php endif; ?>
<?php endforeach; ?>
</div>
...
If the view is empty, however, the divs in the style output template above still print – I'd like to hide them when the view is empty. I alternately considered using Views' built-in header option, but even though I've unchecked the "Display even if view has no result" option" and nothing appears when I preview the view with its necessary contextual filter, the header still appears. Is there a conditional I can wrap around the divs in the style output template file so they don't appear if the view is empty?
Thank you!
Comments