Get absolute (full) url of image from custom page type - Kentico

Klinge Danielle asked on May 4, 2019 14:12

I have a custom page type for infographics with an "Image" field to select item from media library. I'd like to get the absolute URL of the Image in a transformation for RSS feed. The code below only generates the relative URL. I've tried adding GetAbsoluteUrl() in different ways but couldn't make it to work.

Could you help? Thanks!

(This post was edited by the administrator to remove forbidden ads.)

Recent Answers


David te Kloese answered on May 6, 2019 11:08

Dmitry Bastron answered on May 6, 2019 16:31

If you use ASCX transformation you can use this method (assuming that your page type has "Image" field):

<%# GetAbsoluteUrl(Eval("Image")) %>

In Text transformations (HTML for example) you can use K#:

{% GetAbsoluteUrl(Image) %}

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.