Skip to content

Commit

Permalink
Move component title to template
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremysteerio committed Oct 21, 2024
1 parent 5071dbb commit 0552d5a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions hdbt.theme
Original file line number Diff line number Diff line change
Expand Up @@ -1700,13 +1700,6 @@ function hdbt_preprocess_paragraph__event_list(&$variables): void {
$variables['#attached']['drupalSettings']['helfi_events']['baseUrl'] = LinkedEvents::BASE_URL;
}

/**
* Implements hook_preprocess_HOOK().
*/
function hdbt_preprocess_paragraph__curated_event_list(array &$variables): void {
$variables['content']['#title'] = t('Recommended events', [], ['context' => 'Curated event list title']);
}

/**
* Implements hook_preprocess_HOOK().
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'component--curated-event-list',
],
component_title_level: 'h2',
component_title: content['#title'],
component_title: 'Recommended events'|trans({}, {'context': 'Curated event list title'}),
}
%}
{% block component_content %}
Expand Down

0 comments on commit 0552d5a

Please sign in to comment.