{% load wagtailcore_tags %} {% load waggylabs_filters %} {% if sidebar %} {# rendering in the sidebar #}

{{ value.equation }}

{% if visual_settings.preview_buttons_icon_location == 'end' %} {% else %} {% endif %}
{% if value.caption %}
{% if page.equation_caption_label %}

{{ page.equation_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 %}

{{ value.equation }}

{% if value.caption %}
{% if page.equation_caption_label %}

{{ page.equation_caption_label }}

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