Newer
Older
pre-www / src / layout / partials / card.twig
<{% if card.columns %}div{% else %}a href="{{card.url}}"{% endif %} class="card{% if card.columns %} card--columns{% endif %}{% if card.text %} card--column-span{% endif %}{% if card.hide_arrow %} card--no-arrow{% endif %} {{card.classes}}">
    {% if card.columns %}
        <div>
            <header>
                <div class="card__title"><a href="{{card.url}}">{{card.title}}</a> <a href="{{card.url}}" class="card__icon"></a></div>
                {% if card.subtitle %}
                    <p class="card__subtitle">{{card.subtitle}}</p>
                {% endif %}
            </header>
            <footer>
                {% if card.info %}
                    <p>{{card.info}}</p>
                {% endif %}
                <ul>
                    {% if card.email %}
                        <li><a href="mailto:{{card.email}}">{{card.email}}</a></li>
                    {% endif %}
                    {% if card.phone %}
                        <li><a href="tel:{{card.phone}}">{{card.phone}}</a></li>
                    {% endif %}
                    {% if card.links %}
                        {% for link in card.links %}
                            <li><a href="{{link.url}}">{{link.name}}</a></li>
                        {% endfor %}
                    {% endif %}
                </ul>
            </footer>
        </div>
        {% if card.text %}
            <div class="card__content">
                <p>{{card.text}}</p>
            </div>
        {% endif %}                   
    {% else %}
        {% if card.show_excerpt %}
            <p class="card__excerpt">{{card.excerpt|truncate(120)}}</p>
        {% endif %}
        {% if card.show_category %}
            <p class="card__category">{{card.category}}</p>
        {% endif %}
        {% if card.image %}
            <div class="card__img">
                {% include "./picture.twig" with {"image": card.image } %}
            </div>
        {% endif %}
        <div class="card__title">
            <p>{{card.title}}</p>
            {% if card.hide_arrow != true %}
                <div class="card__icon"></div>
            {% endif %}
        </div>
    {% endif %}
    
</{% if card.columns %}div{% else %}a{% endif %}>