Skip to content

Commit

Permalink
Update cards to prevent elements showing as string
Browse files Browse the repository at this point in the history
  • Loading branch information
occupant committed May 30, 2024
1 parent 871aa3d commit d0a2fe6
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions templates/content/node--card-horizontal.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
{% set summary = node.body.summary %}
{% else %}
{% set summaryraw = content.body.0['#text']|striptags %}
{% set summary = '<p class="mt-2">' ~ summaryraw| truncate(300,true,true)| check_markup('filtered_text') ~ '</p>' %}
{% set summary = summaryraw| truncate(300,true,true)| check_markup('filtered_text') %}
{% endif %}
{% endif %}

Expand Down Expand Up @@ -111,7 +111,7 @@
{% endif %}
{% endblock %}
{% block content %}
{{ summary }}
<p class="mt-2">{{ summary }}</p>
{% endblock %}
{% block actions %}
<p>
Expand Down
4 changes: 2 additions & 2 deletions templates/content/node--card-image.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
{% set summary = node.body.summary %}
{% else %}
{% set summaryraw = content.body.0['#text']|striptags %}
{% set summary = '<p class="mt-0">' ~ summaryraw| truncate(300,true,true)| check_markup('filtered_text') ~ '</p>' %}
{% set summary = summaryraw| truncate(300,true,true)| check_markup('filtered_text') %}
{% endif %}
{% endif %}

Expand Down Expand Up @@ -111,7 +111,7 @@
{% endif %}
{% endblock %}
{% block content %}
{{ summary }}
<p class="mt-0">{{ summary }}</p>
{% endblock %}
{% endembed %}

4 changes: 2 additions & 2 deletions templates/content/node--card-vertical.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
{% set summary = node.body.summary %}
{% else %}
{% set summaryraw = content.body.0['#text']|striptags %}
{% set summary = '<p class="mt-0">' ~ summaryraw| truncate(300,true,true)| check_markup('filtered_text') ~ '</p>' %}
{% set summary = summaryraw| truncate(300,true,true)| check_markup('filtered_text') %}
{% endif %}
{% endif %}

Expand Down Expand Up @@ -111,7 +111,7 @@
{% endif %}
{% endblock %}
{% block content %}
{{ summary }}
<p class="mt-0">{{ summary }}</p>
{% endblock %}
{% block actions %}
<p>
Expand Down
4 changes: 2 additions & 2 deletions templates/content/node--ubc-event--card-horizontal.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
{% set summary = node.body.summary %}
{% else %}
{% set summaryraw = content.body.0['#text']|striptags %}
{% set summary = '<p class="mt-2">' ~ summaryraw| truncate(300,true,true)| check_markup('filtered_text') ~ '</p>' %}
{% set summary = summaryraw| truncate(300,true,true)| check_markup('filtered_text') %}
{% endif %}
{% endif %}

Expand All @@ -114,7 +114,7 @@
{% endif %}
{% endblock %}
{% block content %}
{{ summary }}
<p class="mt-2">{{ summary }}</p>
{% endblock %}
{% block actions %}
<p>
Expand Down
4 changes: 2 additions & 2 deletions templates/content/node--ubc-event--card-image.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
{% set summary = node.body.summary %}
{% else %}
{% set summaryraw = content.body.0['#text']|striptags %}
{% set summary = '<p class="mt-2">' ~ summaryraw| truncate(300,true,true)| check_markup('filtered_text') ~ '</p>' %}
{% set summary = summaryraw| truncate(300,true,true)| check_markup('filtered_text') %}
{% endif %}
{% endif %}

Expand All @@ -115,6 +115,6 @@
{% endif %}
{% endblock %}
{% block content %}
{{ summary }}
<p class="mt-2">{{ summary }}</p>
{% endblock %}
{% endembed %}
4 changes: 2 additions & 2 deletions templates/content/node--ubc-event--card-vertical.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
{% set summary = node.body.summary %}
{% else %}
{% set summaryraw = content.body.0['#text']|striptags %}
{% set summary = '<p class="mt-2">' ~ summaryraw| truncate(300,true,true)| check_markup('filtered_text') ~ '</p>' %}
{% set summary = summaryraw| truncate(300,true,true)| check_markup('filtered_text') %}
{% endif %}
{% endif %}

Expand All @@ -115,7 +115,7 @@
{% endif %}
{% endblock %}
{% block content %}
{{ summary }}
<p class="mt-2">{{ summary }}</p>
{% endblock %}
{% block actions %}
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
{% set summary = node.body.summary %}
{% else %}
{% set summaryraw = content.body.0['#text']|striptags %}
{% set summary = '<p>' ~ summaryraw| truncate(300,true,true)| check_markup('filtered_text') ~ '</p>' %}
{% set summary = summaryraw| truncate(300,true,true)| check_markup('filtered_text') %}
{% endif %}
{% endif %}

Expand Down Expand Up @@ -102,7 +102,7 @@
{% if not (node.field_partner_representative.isEmpty == true) and content.field_partner_representative is defined %}
<p><strong>Representative</strong> {{ content.field_partner_representative.0 }}</p>
{% endif %}
{{ summary }}
<p>{{ summary }}</p>
{% endblock %}
{% block actions %}
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
{% set summary = node.body.summary %}
{% else %}
{% set summaryraw = content.body.0['#text']|striptags %}
{% set summary = '<p>' ~ summaryraw| truncate(300,true,true)| check_markup('filtered_text') ~ '</p>' %}
{% set summary = summaryraw| truncate(300,true,true)| check_markup('filtered_text') %}
{% endif %}
{% endif %}

Expand Down Expand Up @@ -103,7 +103,7 @@
{% if not (node.field_partner_representative.isEmpty == true) and content.field_partner_representative is defined %}
<p><strong>Representative</strong> {{ content.field_partner_representative.0 }}</p>
{% endif %}
{{ summary }}
<p>{{ summary }}</p>
{% endblock %}
{% block actions %}
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
{% set summary = node.body.summary %}
{% else %}
{% set summaryraw = content.body.0['#text']|striptags %}
{% set summary = '<p>' ~ summaryraw| truncate(300,true,true)| check_markup('filtered_text') ~ '</p>' %}
{% set summary = summaryraw| truncate(300,true,true)| check_markup('filtered_text') %}
{% endif %}
{% endif %}

Expand Down Expand Up @@ -127,7 +127,7 @@
{% if not (node.field_profile_preferred_website.isEmpty == true) and content.field_profile_preferred_website is defined %}
<p class="mt-0 text-sm"><svg aria-hidden="true" class="inline-block w-4 h-4 mr-5 text-ubc-blue "><use xlink:href="#icon-link-external"></use></svg> <a href="{{ content.field_profile_preferred_website[0]['#url'] }}" class="link-expand-break">Website</a></p>
{% endif %}
{{ summary }}
<p>{{ summary }}</p>
{% endblock %}
{% block actions %}
<p class="text-right">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
{% set summary = node.body.summary %}
{% else %}
{% set summaryraw = content.body.0['#text']|striptags %}
{% set summary = '<p>' ~ summaryraw| truncate(300,true,true)| check_markup('filtered_text') ~ '</p>' %}
{% set summary = summaryraw| truncate(300,true,true)| check_markup('filtered_text') %}
{% endif %}
{% endif %}

Expand Down Expand Up @@ -126,7 +126,7 @@
{% if not (node.field_profile_preferred_website.isEmpty == true) and content.field_profile_preferred_website is defined %}
<p class="mt-0 text-sm"><svg aria-hidden="true" class="inline-block w-4 h-4 mr-5 text-ubc-blue "><use xlink:href="#icon-link-external"></use></svg> <a href="{{ content.field_profile_preferred_website[0]['#url'] }}" class="link-expand-break">Website</a></p>
{% endif %}
{{ summary }}
<p>{{ summary }}</p>
{% endblock %}
{% block actions %}
<p class="text-right">
Expand Down
4 changes: 2 additions & 2 deletions templates/content/node--ubc-profile--card-vertical.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
{% set summary = node.body.summary %}
{% else %}
{% set summaryraw = content.body.0['#text']|striptags %}
{% set summary = '<p>' ~ summaryraw| truncate(300,true,true)| check_markup('filtered_text') ~ '</p>' %}
{% set summary = summaryraw| truncate(300,true,true)| check_markup('filtered_text') %}
{% endif %}
{% endif %}

Expand Down Expand Up @@ -127,7 +127,7 @@
{% if not (node.field_profile_preferred_website.isEmpty == true) and content.field_profile_preferred_website is defined %}
<p class="mt-0 text-sm"><svg aria-hidden="true" class="inline-block w-4 h-4 mr-5 text-ubc-blue "><use xlink:href="#icon-link-external"></use></svg> <a href="{{ content.field_profile_preferred_website[0]['#url'] }}" class="link-expand-break">Website</a></p>
{% endif %}
{{ summary }}
<p>{{ summary }}</p>
{% endblock %}
{% block actions %}
<p class="text-right">
Expand Down

0 comments on commit d0a2fe6

Please sign in to comment.