Skip to content

Commit

Permalink
Merge pull request #169 from SLAC/slacdp22-445-event-external-link-fi…
Browse files Browse the repository at this point in the history
…elds

[SLACDP22-445] Update templates for D9 event external link field
  • Loading branch information
kmonahan committed Apr 13, 2023
2 parents b479830 + 01e501c commit d9a0bcb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions templates/content/node--event--card.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@

{#
/**
* If the "Is external event?" field (field_boolean) is set then use the URL of the external link
* If the "Is external event?" field (field_boolean_2) is set then use the URL of the external link
* field as the title URL. Otherwise use the node URL. External events will not have detail pages.
* The external link field is not required, however, so the card title link may have no href.
*/
#}
{% include '@components/card/card.twig' with {
'is_event': true,
'title': label,
'url': content.field_boolean['#items'].value == 0 ? url : content.field_external_link.0['#url'],
'url': content.field_boolean_2['#items'].value == 0 ? url : content.field_link.0['#url'],
'start_date': {
'month': event_start_date|date('M'),
'day': event_start_date|date('j')
Expand Down
4 changes: 2 additions & 2 deletions templates/content/node--event--large-card.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@

{#
/**
* If the "Is external event?" field (field_boolean) is set then use the URL of the external link
* If the "Is external event?" field (field_boolean_2) is set then use the URL of the external link
* field as the title URL. Otherwise use the node URL. External events will not have detail pages.
* The external link field is not required, however, so the card title link may have no href.
*/
Expand All @@ -140,7 +140,7 @@
'modifier_classes': 'c-card--large',
'is_event': true,
'title': label,
'url': content.field_boolean['#items'].value == 0 ? url : content.field_external_link.0['#url'],
'url': content.field_boolean_2['#items'].value == 0 ? url : content.field_link.0['#url'],
'start_date': {
'month': event_start_date|date('M'),
'day': event_start_date|date('j')
Expand Down
4 changes: 2 additions & 2 deletions templates/content/node--event--list-card.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@

{#
/**
* If the "Is external event?" field (field_boolean) is set then use the URL of the external link
* If the "Is external event?" field (field_boolean_2) is set then use the URL of the external link
* field as the title URL. Otherwise use the node URL. External events will not have detail pages.
* The external link field is not required, however, so the card title link may have no href.
*/
Expand All @@ -134,7 +134,7 @@
'is_event': true,
'is_event_list_card': true,
'title': label,
'url': url,
'url': content.field_boolean_2['#items'].value == 0 ? url : content.field_link.0['#url'],
'start_date': {
'month': event_start_date|date('M'),
'day': event_start_date|date('j')
Expand Down
4 changes: 2 additions & 2 deletions templates/content/node--event--teaser.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@

{#
/**
* If the "Is external event?" field (field_boolean) is set then use the URL of the external link
* If the "Is external event?" field (field_boolean_2) is set then use the URL of the external link
* field as the title URL. Otherwise use the node URL. External events will not have detail pages.
* The external link field is not required, however, so the card title link may have no href.
*/
Expand All @@ -141,7 +141,7 @@
'modifier_classes': 'c-card--teaser',
'is_event': true,
'title': label,
'url': content.field_boolean['#items'].value == 0 ? url : content.field_external_link.0['#url'],
'url': content.field_boolean_2['#items'].value == 0 ? url : content.field_link.0['#url'],
'start_date': {
'month': event_start_date|date('M'),
'day': event_start_date|date('j')
Expand Down

0 comments on commit d9a0bcb

Please sign in to comment.