Skip to content

Commit

Permalink
USAGOV-2019-Missing-Breadcrumbs-on-Wizard-Pages: Adjust wizard breadc…
Browse files Browse the repository at this point in the history
…rumb data to use existing breadcrumb template
  • Loading branch information
cwacht committed Oct 17, 2024
1 parent 1a62fec commit a34fb8c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
9 changes: 6 additions & 3 deletions web/modules/custom/usagov_wizard/usagov_wizard.module
Original file line number Diff line number Diff line change
Expand Up @@ -385,16 +385,19 @@ function usagov_wizard_preprocess_breadcrumb(&$variables) {
if (isset($crumb['uri'])) {
$crumb['url'] = Url::fromUri($crumb['uri'])->toString();
}
if (isset($crumb['title'])) {
$crumb['text'] = ($crumb['title']);
}

$variables['breadcrumb']['crumbs'][] = $crumb;
$variables['wizard_breadcrumb'][] = $crumb;
}
$language = $taxonomy_term->langcode->value;
$home = [
'title' => $language == 'en' ? 'Home' : 'Página principal',
'text' => $language == 'en' ? 'Home' : 'Página principal',
'url' => $language == 'en' ? '/' : '/es',
];
if ($crumbs != NULL) {
array_unshift($variables['breadcrumb']['crumbs'], $home);
array_unshift($variables['wizard_breadcrumb'], $home);
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions web/themes/custom/usagov/templates/breadcrumb.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
{ 'text': drupal_title() }
] %}
{% endif %}

{% if wizard_breadcrumb %}
{% set breadcrumb = wizard_breadcrumb %}
{% endif %}


{% if breadcrumb %}

Expand Down

This file was deleted.

0 comments on commit a34fb8c

Please sign in to comment.