Jump to content

Getting Image Path For Background


Recommended Posts

Hello guys, i want to change images in my slider from <img> to background, before in my template images get by the code: 

<img src="{$link->getMediaLink("`$smarty.const._MODULE_DIR_`homeslider/images/`$slide.image|escape:'htmlall':'UTF-8'`")}"{if isset($slide.size) && $slide.size} {$slide.size}{else} width="100%" height="100%"{/if} alt="{$slide.legend|escape:'htmlall':'UTF-8'}" />

Now i want to make background for every slide like this:

{$image_url=$link->getMediaLink("`$smarty.const._MODULE_DIR_`homeslider/images/`$slide.image|escape:'htmlall':'UTF-8'`")}
<li class="homeslider-container" style="background-image:url("

   {$image_url}

")"> 

But i am getting string without slashes, this is from my browser:

<li class="homeslider-container" style="background-image:url(" http:="" anirionline.com="" modules="" homeslider="" images="" ")"=""> 

How can i do that? Thanks for help!

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...