ImageMap ======== Description ----------- The image map content type allows to assign an arbitrary amount of hotspots to an image. These hotspots can be either circles, rectangles or points. It's possible to define multiple types with different content types included. Every hotspot needs to be one of the defined types. A quite common use case is to create a type containing a text editor. Then it's possible to describe different parts of an image using text. In the front-end this could be implemented using hover areas. If the user hovers over a hotspot, the corresponding text could be shown in a popover. Parameters ---------- No parameters available Example ------- XML ^^^ .. code-block:: xml Image-Map Image-Map Basic Grundlegend Title Titel Description Beschreibung Advanced Erweitert Text Text Twig ^^^^ .. code-block:: twig
{% for index, hotspot in image_map.hotspots %} {% set left = hotspot.hotspot.left * 100 %} {% set top = hotspot.hotspot.top * 100 %} {% if hotspot.hotspot.type == 'rectangle' %} {% set width = hotspot.hotspot.width * 100 %} {% set height = hotspot.hotspot.height * 100 %}
{{ index + 1 }}
{% elseif hotspot.hotspot.type == 'circle' %} {% set diameter = hotspot.hotspot.radius * 100 * 2 %}
{{ index + 1 }}
{% elseif hotspot.hotspot.type == 'point' %}
{{ index + 1 }}
{% endif %} {% endfor %}
{% for index, hotspot in image_map.hotspots %}

#{{ index + 1 }}

{% if hotspot.type == 'basic' %} {{ hotspot.title|default }}

{{ hotspot.description|default }}

{% elseif hotspot.type == 'advanced' %}

{{ hotspot.text|default|raw }}

{% endif %} {% endfor %}