This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Forums » eZ Publish 5 Platform » Get absolute url of an image...

Get absolute url of an image attribute of a class

Get absolute url of an image attribute of a class

Tuesday 10 June 2014 7:02:10 pm - 1 reply

I have a class with an image attribute.

Within the twig template, I can get the relative url (e.g. '/var/site/storage/image/...') from the attribute parameters.

Now I need the absolute url. Which is the best way to get it?

Should I get the request information and append the base url to the relative one? Or there's a built in method for that?


Wednesday 11 June 2014 9:40:14 am

Hi John

You need to use the Request object for that. Example in a Twig template:

{{ app.request.schemeAndHttpHost ~ asset( "var/site/storage/image/..." ) }}

Modified on Wednesday 11 June 2014 9:41:37 am by Jérôme Vieilledent


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from