{# @var craft \craft\web\twig\variables\CraftVariable #} {# @var entry \craft\elements\Entry #} {# Description of what this file is for @package craft3 @author David Hellmann [david@hellmann.io] m-card ------------------------------------------------------------ #} {# -- Set Defaults -- #} {% set defaults = { cn: 'm-card', modifiers: [], customClasses: [], data: {}, js: null, item: null, image: null, content: null, link: null } %} {# -- Merge Default with Options -- #} {% set opt = opt is defined ? defaults|merge(opt) : defaults %} {# -- Modul -- #} {% if opt.item %}
{% if opt.image %} {% include '_atoms/image/_template.html' with { opt: { image: opt.item.entryImage.one(), ratio: 'landscape' } } only %} {% endif %} {% if opt.content %} {% include '_atoms/headline/_template.html' with { opt: { modifiers: [ 'h6' ], text: opt.item.title, size: 'h2' } } only %} {# -- Entry Intro -- #} {% if opt.item.entryIntroText ?? null %} {% include '_atoms/richText/_template.html' with { opt: { text: '

' ~ opt.item.entryIntroText | striptags | truncateOnWord(140) ~ '

' } } only %} {% endif %} {% endif %} {% if opt.link %} Read more {% endif %}
{% endif %}