diff --git a/web/themes/custom/nysenate_theme/nysenate_theme.theme b/web/themes/custom/nysenate_theme/nysenate_theme.theme index 24e46e786c..c4bfa1d99b 100644 --- a/web/themes/custom/nysenate_theme/nysenate_theme.theme +++ b/web/themes/custom/nysenate_theme/nysenate_theme.theme @@ -397,6 +397,9 @@ function nysenate_theme_preprocess_block_content__microsite_hero(&$variables) { } $party = implode(', ', $arr_party); + // incoming senators + $incoming = empty($senator->get('field_microsite_theme')->getValue()); + // District. $district_url = ''; $query = \Drupal::database()->select('taxonomy_term__field_senator', 's') @@ -454,6 +457,7 @@ function nysenate_theme_preprocess_block_content__microsite_hero(&$variables) { $variables['is_active'] = $senator->field_active_senator->value == 1 ? TRUE : FALSE; $variables['socials'] = $socials; $variables['actionbar']['type'] = 'microsite'; + $variables['incoming'] = $incoming; } /** diff --git a/web/themes/custom/nysenate_theme/src/patterns/components/hero/hero.twig b/web/themes/custom/nysenate_theme/src/patterns/components/hero/hero.twig index d6ee118c7d..7f2af4a5f5 100644 --- a/web/themes/custom/nysenate_theme/src/patterns/components/hero/hero.twig +++ b/web/themes/custom/nysenate_theme/src/patterns/components/hero/hero.twig @@ -23,7 +23,8 @@

- {% if not is_active %}former + {% if incoming %}incoming{% endif %} + {% if not is_active and not incoming %}former {% endif %}New York State Senator
{% if senator_microsite_link %} {{ senator_name }} @@ -53,7 +54,7 @@ diff --git a/web/themes/custom/nysenate_theme/src/templates/block/block-content--microsite-hero.html.twig b/web/themes/custom/nysenate_theme/src/templates/block/block-content--microsite-hero.html.twig index 5ca19dc4f6..b2434b1fbf 100644 --- a/web/themes/custom/nysenate_theme/src/templates/block/block-content--microsite-hero.html.twig +++ b/web/themes/custom/nysenate_theme/src/templates/block/block-content--microsite-hero.html.twig @@ -34,5 +34,6 @@ socials: socials, user_id: user_id, message_senator_link: message_senator_link, - your_dashboard_link: "/dashboard" + your_dashboard_link: "/dashboard", + incoming: incoming } only %}