{% extends "web/base.html.twig" %}
{% block javascripts %}
{{ parent() }}
{#
{% if category.latitude is defined and category.longitude is defined %}
<script>
document.addEventListener("DOMContentLoaded", function() {
// Initialize and add the map
function initMap() {
// The location of Uluru
const uluru = {lat: {{ category.latitude }}, lng: {{ category.longitude }} };
// The map, centered at Uluru
const map = new google.maps.Map(document.getElementById("map"), {
zoom: 15,
center: uluru,
});
// The marker, positioned at Uluru
const marker = new google.maps.Marker({
position: uluru,
map: map,
});
}
});
</script>
{% endif %}
#}
{% if category.javascript %}
<script type="text/javascript">
{{ category.javascript | raw }}
</script>
{% endif %}
{% endblock %}
{% block description %}
{{ category.description }}
{% endblock %}
{% block body %}
{% if '@@FORM@@' in category.html|raw %}
{% set content = replaced_content|raw %}
{% for label, messages in app.flashes(['success', 'warning']) %}
{% for message in messages %}
{% set content = content|replace({"@@FORM@@": '<div class="flash-'~label~'">
'~message~'
</div>@@FORM@@'}) %}
{% endfor %}
{% endfor %}
{% set content = content|replace({"@@FORM@@": form(contact_form)})|raw %}
{{ content | raw }}
{% else %}
{{ replaced_content | raw }}
{% endif %}
{% endblock %}