tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/14636-background-image-paths-in-velocity-formatCascade CMS: Discussion 2016-10-02T02:45:10Ztag:help-archives.hannonhill.com,2010-02-09:Comment/405580282016-08-18T14:49:29Z2016-08-18T18:41:20ZBackground Image Paths in Velocity Format<div><p>Hi Steve,</p>
<p>Try the following:<br></p>
<pre>
#set( $file_name = "dome.jpg" )
#set( $s_system_asset = "[system-asset]" )
#set( $e_system_asset = "[/system-asset]" )
<br><!--<img src="${s_system_asset}site://Upstate-Globals/assets/images/about/${file_name}${e_system_asset}" alt="image" />-->
<div style="width:300px;height:300px;background-image:url('${s_system_asset}site://Upstate-Globals/assets/images/about/${file_name}${e_system_asset}');background-color:red"></div>
</pre>
<p>There are two things you need to pay attention to:</p>
<ol>
<li>
<p>You may need to use the <code>img</code> element to force the
image to show up and cached. This is actually a good test for the
path and <code>[system-asset]</code>.</p>
</li>
<li>
<p>You may want to store the variables <code>$s_system_asset</code>
and <code>$e_system_asset</code> in a global format that can be
reused.</p>
</li>
</ol>
<p>Wing</p></div>Wing Ming Chan