Use image from view as background image of div in page.tpl.php I need to use the image resulting from a view as the background image to a div in my page.tpl.php.

I am able to render the page title with the view below it using:          

&lt;div class="container-inner clearfix"&gt;
  &lt;h1 id="page-title"&gt;
    &lt;span&gt;&lt;?php print $title ?&gt;&lt;/span&gt;            
  &lt;/h1&gt;
  &lt;?php $views = views_embed_view('photos', 'block'); print render($views);?&gt;
&lt;/div&gt;


However, is there a way that I can pull the image from the view, and use it as the background image for container-inner?
Sure.  Just look at what's inside $views and grab the path/url of the image there and stuff that into $background_image and then do something like:

&lt;div class="container-inner clearfix" style="background: url(&lt;?php print $background_image; ?&gt;)"&gt;


Sidenote:  it might be better to this in a preprocess hook and pass in this as a variable instead of putting this logic in your page.tpl.php file, eg, something like:

function my_module_or_theme_preprocess_page(&amp;$vars) {

  // $views=views_embed_view('photos', 'block');
  $views=views_get_view_result('photo', 'block'); // appears to work easier :)
  $background_image=// however you get the url/path to the image from $views;

  $vars['background_image']=$background_image;

}


which will create a $background_image variable that is now available inside page.tpl.php.