You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by æon <ae...@gmail.com> on 2010/09/21 22:15:30 UTC

$url Media Files 5.0.0-RC2

How do I get the URL of a file uploaded to "Media Files" with Velocity?

with Roller 3.01 is "$url.resource(filename)"
but with Roller 5.0.0-RC2 I don't know how.




Enrique Fuenzalida M.
http://www.individual.cl/

Re: $url Media Files 5.0.0-RC2

Posted by Dave <sn...@gmail.com>.
On Tue, Sep 21, 2010 at 4:15 PM, æon <ae...@gmail.com> wrote:
> How do I get the URL of a file uploaded to "Media Files" with Velocity?
>
> with Roller 3.01 is "$url.resource(filename)"
> but with Roller 5.0.0-RC2 I don't know how.

Yes, that is a disadvantage of Roller 5's image handling: you have to
copy the image URL from the image information page. The advantage is
that if you move images around in the directory structure, the URLs
all stay the same and you won't break image tags. So...

Any images that existed before your Roller 5 upgrade will still work
with $url.resource(filePath). Like so:

   <img src='$url.resource("/foo/bar.img") />

But new images that you upload you will have to refer to by URL. To
get an images URL, go to the Media File Manager page, select your
image and then copy the Link (URL) from the page. Like so:

   <img src='http://example.org/roller/mediaresource/0da9a18c-217c-46b8-94cb-7f2343133cbc"
/>

Hope that helps.

- Dave