diff --git a/hdbt.info.yml b/hdbt.info.yml index dfaf27a95..ee7008aa4 100644 --- a/hdbt.info.yml +++ b/hdbt.info.yml @@ -3,7 +3,7 @@ description: Base theme for Helsinki Drupal instances. type: theme base theme: stable9 tags: sub-theme -core_version_requirement: ^8 || ^9 +core_version_requirement: ^9 || ^10 'interface translation project': hdbt 'interface translation server pattern': themes/contrib/hdbt/translations/%language.po diff --git a/hdbt.theme b/hdbt.theme index 137cca329..f028ac029 100644 --- a/hdbt.theme +++ b/hdbt.theme @@ -1600,9 +1600,12 @@ function hdbt_preprocess_paragraph__event_list(&$variables): void { $variables['#attached']['drupalSettings']['helfi_events']['data'][$paragraph->id()] = $settings; } + /** @var \Drupal\Core\Extension\ExtensionPathResolver $extensionPathResolver */ + $extensionPathResolver = \Drupal::service('extension.path.resolver'); + // Render image placeholder for use in frontend. $variables['#attached']['drupalSettings']['helfi_events']['imagePlaceholder'] = twig_render_template( - drupal_get_path('theme', 'hdbt') . '/templates/misc/image-placeholder.twig', + $extensionPathResolver->getPath('theme', 'hdbt') . '/templates/misc/image-placeholder.twig', [ 'image_placeholder' => 'calendar-clock', 'theme_hook_original' => '', diff --git a/templates/media/media--remote-video.html.twig b/templates/media/media--remote-video.html.twig index f95bf68b6..235488858 100644 --- a/templates/media/media--remote-video.html.twig +++ b/templates/media/media--remote-video.html.twig @@ -52,7 +52,7 @@ 'src': media_attributes.src, 'height': media_attributes.height, 'width': media_attributes.width, - 'title': iframe_title, + 'title': 'Video: ' ~ iframe_title, 'type': 'video', } } diff --git a/templates/navigation/menu--external-menu--fallback.html.twig b/templates/navigation/menu--external-menu--fallback.html.twig index bcf7c84c2..789c8ae94 100644 --- a/templates/navigation/menu--external-menu--fallback.html.twig +++ b/templates/navigation/menu--external-menu--fallback.html.twig @@ -29,18 +29,18 @@ {# Render "back" menu link. #} {% if menu_link_back %} - {% spaceless %} + {% apply spaceless %} {% set menu_link_back_title %} {{ item_title }} {% endif %} @@ -96,10 +96,10 @@ {% set next_item_title %} {{ 'Open submenu:'|t({}, {'context': 'Mobile navigation submenu prefix'}) }} {{ item_title }} {% endset %} - {% spaceless %} + {% apply spaceless %} {% set link_attributes = { 'class': [ 'mmenu__forward' ] } %} {{ link(next_item_title, item.next_url, link_attributes) }} - {% endspaceless %} + {% endapply %} {% endif %} {% endfor %} diff --git a/templates/navigation/menu--external-menu--mega-menu.html.twig b/templates/navigation/menu--external-menu--mega-menu.html.twig index ebd5ed810..95f4ed54b 100644 --- a/templates/navigation/menu--external-menu--mega-menu.html.twig +++ b/templates/navigation/menu--external-menu--mega-menu.html.twig @@ -73,7 +73,7 @@ {% endset %} {% if not item.is_nolink %} - {% spaceless %} + {% apply spaceless %} {% set icon_name = (item.url.getOption('attributes')).icon %} {% if icon_name %} @@ -94,7 +94,7 @@ {{ link(item_title, item.url, link_attributes) }} - {% endspaceless %} + {% endapply %} {% else %} {{ item.title }} {% endif %} diff --git a/templates/navigation/menu--mobile.html.twig b/templates/navigation/menu--mobile.html.twig index 4c42c41ad..8740fb935 100644 --- a/templates/navigation/menu--mobile.html.twig +++ b/templates/navigation/menu--mobile.html.twig @@ -68,7 +68,7 @@ {% set item_title = item.title %} {% if not item.is_nolink %} - {% spaceless %} + {% apply spaceless %} {% set icon_name = (item.url.getOption('attributes')).icon %} {% if icon_name %} @@ -89,7 +89,7 @@ {{ link(item_title, item.url, link_attributes) }} - {% endspaceless %} + {% endapply %} {% else %} {{ item.title }} {% endif %} diff --git a/templates/navigation/menu.html.twig b/templates/navigation/menu.html.twig index de50e302f..d6c0b161a 100644 --- a/templates/navigation/menu.html.twig +++ b/templates/navigation/menu.html.twig @@ -74,7 +74,7 @@
{% endset %} {% set link_attributes = {'class': [ 'mmenu__back mmenu__back--in-path' ]} %} {{ link(menu_link_back_title, menu_link_back.url, link_attributes) }} - {% endspaceless %} + {% endapply %} {% endif %} {# Current page link #} {% if menu_link_current_or_parent %} - {% spaceless %} + {% apply spaceless %} {% set menu_link_current_or_parent_title %} {{ menu_link_current_or_parent.title }} {% endset %} @@ -52,7 +52,7 @@ 'aria-current': menu_link_current_or_parent.is_currentPage ? 'page': null, } %} {{ link(menu_link_current_or_parent_title, menu_link_current_or_parent.url, link_attributes) }} - {% endspaceless %} + {% endapply %} {% endif %} {% if items %} @@ -78,7 +78,7 @@ {% endset %} {% if not item.is_nolink %} - {% spaceless %} + {% apply spaceless %} {% set link_attributes = { 'class': [ 'mmenu__item-link', @@ -87,7 +87,7 @@ 'aria-current': item.is_currentPage ? 'page': null, } %} {{ link(item_title, item.url, link_attributes) }} - {% endspaceless %} + {% endapply %} {% else %}