Skip to content

Commit

Permalink
feat: ysp-301 add templates for text-card view mode
Browse files Browse the repository at this point in the history
  • Loading branch information
laura-johnson committed Mar 12, 2024
1 parent 1bc63a4 commit 6a6043e
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
28 changes: 28 additions & 0 deletions templates/node/node--event--text-card.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{ attach_library('atomic/reference-card') }}

{% set date__formatted %}
{% include "@atoms/date-time/yds-date-time.twig" with {
date_time__start: content.field_event_date.0.start_time['#markup'],
} %}
{% endset %}

{% if content.field_event_type %}
{% set reference_card__overline -%}
{% include "@molecules/cards/reference-card/event/_yds-event-format.twig" with {
format: content.field_event_type,
} %}
{%- endset %}
{% endif %}

{% set heading = content.field_teaser_title.0 ? content.field_teaser_title : label %}

{% set url = content.field_external_source[0]['#url']|render ? content.field_external_source[0]['#url']|render : url %}

{% embed "@molecules/cards/reference-card/yds-reference-card.twig" with {
reference_card__heading: heading,
reference_card__subheading: date__formatted,
reference_card__url: url,
reference_card__snippet: content.field_teaser_text,
reference_card__image: 'false',
} %}
{% endembed %}
13 changes: 13 additions & 0 deletions templates/node/node--page--text-card.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ attach_library('atomic/reference-card') }}

{% set heading = content.field_teaser_title.0 ? content.field_teaser_title : label %}
{% set url = content.field_external_source[0]['#url']|render ? content.field_external_source[0]['#url']|render : url %}

{% embed "@molecules/cards/reference-card/yds-reference-card.twig" with {
reference_card__heading: heading,
reference_card__subheading: date__formatted,
reference_card__url: url,
reference_card__snippet: content.field_teaser_text,
reference_card__image: 'false',
} %}
{% endembed %}
20 changes: 20 additions & 0 deletions templates/node/node--post--text-card.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{ attach_library('atomic/reference-card') }}

{% set date__formatted %}
{% include "@atoms/date-time/yds-date-time.twig" with {
date_time__start: date_formatted,
date_time__format: 'date',
} %}
{% endset %}

{% set heading = content.field_teaser_title.0 ? content.field_teaser_title : label %}
{% set url = content.field_external_source[0]['#url']|render ? content.field_external_source[0]['#url']|render : url %}

{% embed "@molecules/cards/reference-card/yds-reference-card.twig" with {
reference_card__overline: date__formatted,
reference_card__heading: heading,
reference_card__url: url,
reference_card__snippet: content.field_teaser_text,
reference_card__image: 'false',
} %}
{% endembed %}
13 changes: 13 additions & 0 deletions templates/node/node--profile--text-card.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ attach_library('atomic/reference-card') }}

{% set heading = content.field_teaser_title.0 ? content.field_teaser_title : label %}
{% set url = content.field_external_source[0]['#url']|render ? content.field_external_source[0]['#url']|render : url %}

{% embed "@molecules/cards/reference-card/yds-reference-card.twig" with {
reference_card__heading: heading,
reference_card__subheading: content.field_position,
reference_card__url: url,
reference_card__snippet: content.field_subtitle,
reference_card__image: 'false',
} %}
{% endembed %}

0 comments on commit 6a6043e

Please sign in to comment.