I would like to set a background image on a div in my views-view.tpl.php using the image from a rendered entity field in the View Header.
Something like:
<div class="group-header" style="background-image:;">
<div class="group-heading container">
<?php print render($title_prefix); ?>
<?php if ($title): ?>
<div class="page-title">
<h1 class="l-view-title"><?php print t($title)?></h1>
</div>
<?php endif; ?>
<?php print render($title_suffix); ?>
<?php if ($header): ?>
<?php print $header; ?>
<?php endif; ?>
</div>
</div>
How do I print just the url of the entity from the header? It would be great if I could pull the image URL and add an inline style on the group-header
div. Any ideas on how to accomplish this?
Similar to this question: Use image from view as background image of div in page.tpl.php