{# Media Image =========== Image Container Element, can overlap Pageborder @param {string} name = Classname @param {object} data = dataobject @param {object} data.photo = Image Object (only one Image) @param {string} data.caption = Optional Image Caption @param {object} options = Optionsobject @param {object} options.style = Optional Styleclass @param {string} options.ratio = Optional Imageratio (format: `16:9`) @param {bool} options.heightrestriction = Restrict the max Imageheight to 100vh #} {# Load Macro if not available #} {% if _ is not defined %} {% import '_macros/my-macro.html' as _ %} {% endif %} {% set height = '' %} {# Set Heightrestriction Modifier #} {% if not options.ratio|length %} {% set height = options.heightrestriction ? ' c-mediaimage--maxheight' %} {% endif %} {# Build Element Block #}
{{ _.mediaImageSet(data.photo.first(), options.ratio, { class: 'c-mediaimage__image', imgix: { imgixParams: options.imgixParam is defined and not null ? options.imgixParam|json_decode : {} } }) }} {% if data.caption %} {% include '_components/caption.html' with { caption: data.caption, layout: 'align' } %} {% endif %}