- Issue created by @ilyaselhaddaji
- Status changed to RTBC
9 months ago 9:34am 22 February 2024 - 🇫🇷France goz
Extra-information : we should use drupal mechanisms path() or ur() instead of hard href so url can be altered by Drupal core, contrib and custom modules.
- Status changed to Needs work
9 months ago 6:02pm 23 February 2024 - 🇫🇷France pdureau Paris
Hello,
we should use drupal mechanisms path() or ur() instead of hard href so url can be altered by Drupal core, contrib and custom modules.
We shouldn't use those functions (path() & url()) in a component templates. They are stateful and application related because they do DB query to get routing information.
However, I understand you are not comfortable with hardcoding "/" in the template. A better solution would be to add a new URL prop ("settings") in https://git.drupalcode.org/project/ui_suite_dsfr/-/blob/1.0.x/templates/... :
settings: home_url: type: url label: Homepage URL preview: /
Use it in https://git.drupalcode.org/project/ui_suite_dsfr/-/blob/1.0.x/templates/... :
{% if home_url and (not operator_logo) and (not service_title) %} <a href="{{ home_url|default("/") " title="{{ 'Homepage'|t }} - {{ logo_text }}"> {% endif %} ...
And then you can use path() or url() from https://git.drupalcode.org/project/ui_suite_dsfr/-/blob/1.0.x/templates/... :
{{ pattern('header', { 'logo_text': page.logo, 'home_url': path('<front>'), 'operator_logo': page.header_operator_logo, 'service_title': site_name, 'service_tagline': site_slogan, 'tools_links': page.header_tools_links, 'tools_search': page.header_tools_search, 'navbar': page.header_navbar, }) }}
- 🇫🇷France just_like_good_vibes PARIS
hello,
the issue also occurs in the footer pattern - Status changed to Needs review
9 months ago 10:26am 28 February 2024 - 🇫🇷France just_like_good_vibes PARIS
hello Pierre, you are right, i will push it now.
thank you for checking carefully :) -
pdureau →
committed ffcb3f6c on 1.0.x authored by
just_like_good_vibes →
Issue #3422665 by just_like_good_vibes, ilyaselhaddaji: Link to homepage...
-
pdureau →
committed ffcb3f6c on 1.0.x authored by
just_like_good_vibes →
- Issue was unassigned.
- Status changed to Fixed
8 months ago 2:13pm 10 March 2024 Automatically closed - issue fixed for 2 weeks with no activity.