socialfeed-instagram-post-image.html.twig in Social Feed 8
{% if post.media_url %}
{% set alt = post.raw.caption ? post.raw.caption[:50] ~ (post.raw.caption|length > 50 ? '...') : '' %}
{% if post.post_url %}
<a href="{{ post.post_url }}">
<img src="{{ post.media_url }}" alt="{{ alt }}"/>
</a>
{% else %}
<img src="{{ post.media_url }}" alt="{{ alt }}"/>
{% endif %}
{% endif %}
File
templates/socialfeed-instagram-post-image.html.twig
View source
- {% if post.media_url %}
- {% set alt = post.raw.caption ? post.raw.caption[:50] ~ (post.raw.caption|length > 50 ? '...') : '' %}
- {% if post.post_url %}
- <a href="{{ post.post_url }}">
- <img src="{{ post.media_url }}" alt="{{ alt }}"/>
- </a>
- {% else %}
- <img src="{{ post.media_url }}" alt="{{ alt }}"/>
- {% endif %}
- {% endif %}