{% if thumbnailString == '' %}
{% set thumbnailString = 'col-6' %}
{% endif %}
{% set markers = image.getMarker() %}
{% set markerX = '' %}
{% set markerY = '' %}
{% set break = false %}
{% for marker in markers %}
{% if not break %}
{% if marker.data == [] and marker.name == '' %}
{% set markerX = marker.left %}
{% set markerY = marker.top %}
{% set break = true %}
{% endif %}
{% endif %}
{% endfor %}
{# This is how the image postion is determined.
If one coordinate fits within an area it gets the corresponding class
x
y +---left---+--center--+-- right--+
top | < 33.333 | < 66.666 | < 100 |
|----------|----------|----------|
center | < 66.666 | | |
|----------|----------|----------|
bottom | < 100 | | |
+----------+----------+----------+
#}
{% if markerX > 0 and markerY > 0 %}
{% set imagePosition = image_marker_position_x_y(markerX, markerY) %}
{% else %}
{% set imagePosition = 'center-center' %}
{% endif %}
<div class="image-position-{{imagePosition}}">
{{ image.thumbnail(thumbnailString).html | raw }}
{% if imageTitleShow %}
{% set image = image.getImage() %}
{% if imageTitleInput %}
<div class="c-image__title">
{{ imageTitleInput | raw }}
</div>
{% elseif image.getMetadata('title') %}
<div class="c-image__title">
{{ image.getMetadata('title') | raw }}
</div>
{% endif %}
{% endif %}
</div>