Skip to content

Commit

Permalink
fix error when indexing ImagePagepart
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristof Jochmans committed May 20, 2014
1 parent 381e46a commit 717e12f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Resources/views/ImagePagePart/view.html.twig
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{% if resource.media is not empty %}
<div class="image-pp">
{%- if resource.link is defined and resource.link != "" -%}
<a href="{{ resource.link }}" {% if resource.openinnewwindow %}target="_blank"{% endif %}><img src="{{ app.request.schemeandhttphost ~ app.request.basePath ~ asset(resource.media.url) }}" alt="{{ resource.alttext }}" /></a>
{%- else -%}
<img src="{{ app.request.schemeandhttphost ~ app.request.basePath ~ asset(resource.media.url) }}" alt="{{ 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 != "" %}
<a href="{{ resource.link }}" {% if resource.openinnewwindow %}target="_blank"{% endif %}><img src="{{ imgUrl }}" alt="{{ resource.alttext }}" /></a>
{% else %}
<img src="{{ imgUrl }}" alt="{{ resource.alttext }}" />
{% endif %}
</div>
{% endif %}

0 comments on commit 717e12f

Please sign in to comment.