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-MapImage-MapBasicGrundlegendTitleTitelDescriptionBeschreibungAdvancedErweitertTextText
.. note::
You can use global block-types also for the image_map content-type. See
:ref:`template properties ` for more information.
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 %}