{% load wagtailcore_tags %} {% load wagtailembeds_tags %} {% load waggylabs_filters %} {% if sidebar %} {# rendering in the sidebar #}
{% embed value.embed.url %}
{% if visual_settings.preview_buttons_icon_location == 'end' %} {{ visual_settings.preview_buttons_text }} {% if visual_settings.preview_buttons_icon|is_icon %} {% endif %} {% else %} {% if visual_settings.preview_buttons_icon|is_icon %} {% endif %} {{ visual_settings.preview_buttons_text }} {% endif %}
{% if value.caption %}
{% if page.embed_caption_label %}

{{ page.embed_caption_label }}

{% endif %} {{ value.caption|markdown:page.pk|safe }}
{% endif %}
{% elif modal %} {# Modals are always renedered on the main page because they are not working well in case of rendering inside sticky sidebar tabs #} {% else %}
{% if not after_cut %}
{% embed value.embed.url %}
{% endif %} {% if value.caption %}
{% if page.embed_caption_label %}

{{ page.embed_caption_label }}

{% endif %} {{ value.caption|markdown:page.pk|safe }}
{% endif %}
{% endif %}