Skip to content

Commit

Permalink
Merge pull request #2769 from insiders/assets-url
Browse files Browse the repository at this point in the history
[AllBundles] Use absolute_url twig function instead of using app.request data
  • Loading branch information
acrobat authored Oct 12, 2020
2 parents 571b102 + fd4bad8 commit bdacee7
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% endif %}

<p class="download-pp">
<a href="{{ app.request.schemeandhttphost ~ app.request.basePath ~ asset(resource.media.url) }}" target="_blank" class="download">{{ name }}</a>
<a href="{{ absolute_url(asset(resource.media.url)) }}" target="_blank" class="download">{{ name }}</a>
<span>| {{ resource.media.contentTypeShort }} {{ resource.media.getFileSize() }}</span>
</p>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
{{ 'media.media.mediainfo.downloadlink'|trans }}:
</dt>
<dd>
<a href="{{ app.request.getScheme()~'://'~app.request.getHttpHost()~asset(media.url) }}" target="_blank">
{{ app.request.getScheme()~'://'~app.request.getHttpHost()~asset(media.url) }}
{% set mediaUrl = media.url %}
<a href="{{ absolute_url(asset(mediaUrl)) }}" target="_blank">
{{ absolute_url(asset(mediaUrl)) }}
</a>
</dd>
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block extraactions %}

{% if handler.aviaryApiKey and not (handler.aviaryApiKey starts with 'Register') %}
<button type="button" class="btn btn-primary btn--raise-on-hover" onclick="return launchEditor('editimage', '{{ app.request.getScheme()~'://'~app.request.getHttpHost()~asset(media.url) }}');" >
<button type="button" class="btn btn-primary btn--raise-on-hover" onclick="return launchEditor('editimage', '{{ absolute_url(asset(media.url)) }}');" >
{{ 'media.media.edit.action' | trans }}
</button>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
{% if name is empty %}
{% set name = "Download" %}
{% endif %}
<p class="download-pp"><a href="{{ app.request.schemeandhttphost ~ app.request.basePath ~ asset(resource.media.url) }}" target="_blank" class="download">{{ name }}</a> <span>| {{ resource.media.contentTypeShort }} {{ resource.media.getFileSize() }}</span></p>
<p class="download-pp"><a href="{{ absolute_url(asset(resource.media.url)) }}" target="_blank" class="download">{{ name }}</a> <span>| {{ resource.media.contentTypeShort }} {{ resource.media.getFileSize() }}</span></p>
{% endif %}

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="image-pp">
{% set imgUrl = '' %}
{% if app.request %}
{% set imgUrl = app.request.schemeandhttphost ~ app.request.basePath ~ asset(resource.media.url) %}
{% set imgUrl = absolute_url(asset(resource.media.url)) %}
{% endif %}
{% if resource.link is defined and resource.link != "" %}
<a href="{{ resource.link | replace_url}}" {% if resource.openinnewwindow %}target="_blank"{% endif %}><img src="{{ imgUrl }}" alt="{{ resource.alttext }}" /></a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<meta name="twitter:player" content="{{ videoUrl }}" />
<meta name="twitter:player:width" content="960">
<meta name="twitter:player:height" content="540">
<meta name="twitter:image:src" content="{{ app.request.schemeandhttphost ~ asset(seo.twitterImage.metaData.thumbnail_url) }}" />
<meta name="twitter:image:src" content="{{ absolute_url(asset(seo.twitterImage.metaData.thumbnail_url)) }}" />
{% else %}
<meta name="twitter:image:src" content="{{ asset(seo.twitterImage.url | imagine_filter('tw_card_image')) }}" />
{% endif %}
Expand Down

0 comments on commit bdacee7

Please sign in to comment.