3214 Posts in 848 Topics by 810 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 381 Views |
-
SOLVED: Getting Filename of a resized image in view

22 November 2011 at 5:22am Last edited: 22 November 2011 5:22am
Hi All,
I'm looking for a way to geht just the path to an resized image in a template, i.e.
<div style="background:url($Img.SetWidth(100).Filename)"></div>
unfortunately when I'm writing it this way, I get
<div style="background:url(<img src="/path/to/image.jpg" alt="image" />.Filename)"></div>
Is it possible to get the filename without writing an extra method to the model?
Thanks for any hint!
Regards
SF -
Re: SOLVED: Getting Filename of a resized image in view

22 November 2011 at 8:03am Last edited: 22 November 2011 8:04am
Hi Silverfish,
try
<div style="background-image: url(<% control Image.SetWidth(100) %>$URL<% end_control %>)"></div>
or
<div style="background-image: url(<% control Image %><% control SetWidth(100) %>$URL<% end_control %><% end_control %>)"></div>
-
Re: SOLVED: Getting Filename of a resized image in view

23 November 2011 at 12:34am
Hi Rob,
The first one did the job, thanks a lot!
SF
| 381 Views | ||
|
Page:
1
|
Go to Top |


