How to use an image styled by ImageCache Actions as background for a node? I am trying to implement a custom banner with some text written on it. 


I have created a custom content type called banner with 2 fields: an image field and a text field. 
Then I process the image field through ImageCache actions in order to apply a watermark on a photo. (fine till now)


I want to use this image (the output of imagecache_actions) as a background image of a node, so that I can apply the text on top of it. 

So now node is something like the following.

&lt;div class="node" &gt;
    &lt;img src="" /&gt; 
    &lt;div class=text&gt; blabla &lt;/div&gt; 
&lt;/div&gt;


I want to change it to the following.

&lt;div class="node" style="background: //use processed field by imagecache actions"&gt;
    &lt;div class=text&gt; blabla &lt;/div&gt;
&lt;/div&gt;


Seen from a different perspective, if I could dynamically overlay some text on top of the image, then that would also do the trick!

Can you suggest any idea?
I would create some dynamic CSS on the fly and add it to the head of the document.

$styled_image_path = image_style_url('style_name', $image_path);

$css = '
.node {
  background-image: url(' . $styled_image_path . ');
}
';

drupal_add_css($css, array('type' =&gt; 'inline'));


You can add this to a hook_preprocess_node() to check for a specific node before adding to the page.