{# @var craft \craft\web\twig\variables\CraftVariable #} {# @var entry \craft\elements\Entry #} {# m-figure ------------------------------------------------------------ #} {# -- Set Defaults -- #} {% set defaults = { cn: 'm-figure', modifiers: [], customClasses: [], data: {}, js: null, image: null, ratio: null, dominantColor: true, caption: null, captionHeadline: null, captionText: null, captionSource: null, captionSourceUrl: null, objectFit: null } %} {# -- Merge Default with Options -- #} {% set opt = opt is defined ? defaults|merge(opt) : defaults %} {# -- Modul -- #} {% if opt.image %}
{# -- image -- #} {% include '_atoms/image/_template.html' with { opt: { image: opt.image, ratio: opt.ratio, dominantColor: opt.dominantColor, objectFit: opt.objectFit } } only %}
{% if opt.caption %}
{# -- caption -- #} {% include '_molecules/caption/_template.html' with { opt: { headline: opt.captionHeadline ?? null, text: opt.captionText ?? null, source: opt.captionSource ?? null, sourceUrl: opt.captionSourceUrl ?? null } } only %}
{% endif %}
{% endif %}