card.twig 2 KB
Newer Older
1
{% import '@base/macros/uw.macro.twig' as macros %}
2

3
4
5
6
7
{% if type == 'teaser' %}
  {% set show_title = 'yes' %}
{% elseif media and media.type == 'image' %}
  {% set show_title = 'no' %}
{% else %}
8
  {% set show_title = 'no' %}
9
10
{% endif %}

11
<article class="card{% if type %} card__{{ type }}{% endif %}{% if modifier_classes %} card__{{ modifier_classes }}{% endif %}{% if show_hover %} card--show-hover {% endif %}" >
12

13
14
15
16
17
  {% if media %}
    {% include '@components/card/card-elements/_media.twig' with {
      'media': media,
      'header': header,
    } %}
18
  {% endif %}
19

20
  {% if image and show_image == 'yes' %}
21
22
23
    {% include '@components/card/card-elements/_image.twig' with {
      'image': image
    } %}
24
  {% endif %}
25

26
  {% if header and show_title == 'yes' %}
27
28
    {% include '@components/card/card-elements/_header.twig' with {
      'header': header,
29
      'show_title': show_title,
30
31
32
      'type': type,
      'image': image,
      'bundle': bundle
33
    } %}
34
  {% endif %}
35

Eric Bremner's avatar
Eric Bremner committed
36
  {% if content or banner %}
37
38
39
40
41
42
    <div class="card__body">
      {% if banner %}
        {% include '@components/card/card-elements/_banner.twig' with {
          'banner': banner
        } %}
      {% endif %}
43

44
45
      {% if content %}
        {% include '@components/card/card-elements/_content.twig' with {
46
          'content': content,
47
48
49
50
        } %}
      {% endif %}
    </div>
  {% endif %}
51

52
53
  {% if footer %}
    <div class="card__footer">
54

55
56
57
      {% include '@components/card/card-elements/_footer-elements.twig' with {
        'footer': footer
      } %}
58
59
60
61
62
63
64
65
66
67
68
69
70
71

      {% if read_more and url %}
        <div class="card__readmore">
          {{ macros.readmore(url, title) }}
        </div>
      {% endif %}

      {%  if social_media %}
        <div class="card__social {{ social_media_placement }}">
          {% include "@components/menu/menu--social/menu--social.twig" %}
        </div>
      {% endif %}
    </div>
  {% endif %}
72
73
74
75
76
77
78

  {% if tags %}
    {% include '@components/card/card-elements/_tags.twig' with {
      'tags': tags
    } %}
  {% endif %}

79
</article>