From 717e12f9f09b7a27ec53f75e3288365ddf9d2f9b Mon Sep 17 00:00:00 2001 From: Kristof Jochmans Date: Tue, 20 May 2014 11:33:11 +0200 Subject: [PATCH] fix error when indexing ImagePagepart --- Resources/views/ImagePagePart/view.html.twig | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Resources/views/ImagePagePart/view.html.twig b/Resources/views/ImagePagePart/view.html.twig index 2acb805..168eefa 100755 --- a/Resources/views/ImagePagePart/view.html.twig +++ b/Resources/views/ImagePagePart/view.html.twig @@ -1,9 +1,13 @@ {% if resource.media is not empty %}
- {%- if resource.link is defined and resource.link != "" -%} - {{ resource.alttext }} - {%- else -%} - {{ resource.alttext }} - {%- endif -%} + {% set imgUrl = '' %} + {% if app.request %} + {% set imgUrl = app.request.schemeandhttphost ~ app.request.basePath ~ asset(resource.media.url) %} + {% endif %} + {% if resource.link is defined and resource.link != "" %} + {{ resource.alttext }} + {% else %} + {{ resource.alttext }} + {% endif %}
{% endif %}