Problem/Motivation
In #3215784: [META] Fix up topics to use new help_route_link function, the patch was too large and too burdensome to review, so the issue was re-scoped and child issues created. The patches in #58 (9.5.x) and #61 (10.1.x) can be used as a reference.
On #3090659: Make a way for help topics to generate links only if they work and are accessible, we've added two new functions for making safe links with access checks in help topics.
Related change record is https://www.drupal.org/node/3192582
As an example, this is how the block.place.html.twig file was updated in the patch on that issue (that was the only production topic that was updated):
-{% set layout_url = render_var(url('block.admin_display')) %}
+{% set layout_link_text %}
+{% trans %}Block layout{% endtrans %}
+{% endset %}
+{% set layout_link = render_var(help_route_link(layout_link_text, 'block.admin_display')) %}
...
- <li>{% trans %}In the <em>Manage</em> administrative menu, navigate to <em>Structure</em> > <a href="{{ layout_url }}"><em>Block layout</em></a>.{% endtrans %}</li>
+ <li>{% trans %}In the <em>Manage</em> administrative menu, navigate to <em>Structure</em> > {{ layout_link }}.{% endtrans %}</li>
...
- <li>{% trans %}Configure the block and click <em>Save block</em>; see <a href="{{ configure }}">Configuring a previously-placed block</a> for configuration details.{% endtrans %}</li>
+ <li>{% trans %}Configure the block and click <em>Save block</em>; see {{ configure_topic }} for configuration details.{% endtrans %}</li>
Steps to reproduce
N/A
Proposed resolution
1. Update breadcrumb links in steps or standalone "navigate to X" links in the following help topics:
- core/modules/help_topics/help_topics/ban.banning_ips.html.twig
- core/modules/help_topics/help_topics/block.configure.html.twig
- core/modules/help_topics/help_topics/block_content.add.html.twig
- core/modules/help_topics/help_topics/block_content.type.html.twig
- core/modules/help_topics/help_topics/book.adding.html.twig
- core/modules/help_topics/help_topics/book.configuring.html.twig
- core/modules/help_topics/help_topics/book.organizing.html.twig
- core/modules/help_topics/help_topics/config.export_full.html.twig
- core/modules/help_topics/help_topics/config.export_single.html.twig
- core/modules/help_topics/help_topics/config.import_full.html.twig
- core/modules/help_topics/help_topics/config.import_single.html.twig
- core/modules/help_topics/help_topics/config_translation.overview.html.twig
2. Ensure that no other breadcrumb links need to be updated in ban-, block-, or block_content-, config-, config_translation-prefixed help topics. (Search for usages of render_var(url(
or uses of HTML anchor tags (for breadcrumbs only!) in those help topics.)
3. Please do NOT include any sentence-embedded links in the patch, as these will be reviewed in a separate issue with respect to translatability.
Remaining tasks
Patch, review, commit.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
Not necessary. This is an experimental module.
Comment | File | Size | Author |
---|---|---|---|
#7 | interdiff-5-7.txt | 15.56 KB | smustgrave |
#7 | 3307691-7.patch | 20.92 KB | smustgrave |
Comments
Comment #2
Amber Himes MatzUpdating issue to remove aggregator and color module help topics since these modules are slated for removal in Drupal 10. There is a separate issue for these modules' updates in #3307700: Update breadcrumbs in aggregator, color, and tracker help topics to use help_route_link function.
Comment #3
smustgrave CreditAttribution: smustgrave at Mobomo commentedCopied from the original main patch
Verified it applies to 10.0.x branch also.
Comment #4
Amber Himes Matz@smustgrave Thanks for the patch! Could you add the following (from the original patch):
core/modules/help_topics/help_topics/book.adding.html.twig
core/modules/help_topics/help_topics/book.configuring.html.twig
core/modules/help_topics/help_topics/book.organizing.html.twig
Comment #5
smustgrave CreditAttribution: smustgrave at Mobomo commentedSorry about that not sure how I missed those
Comment #6
Amber Himes MatzThank you for the patch @smustgrave!
We want to replace the entire
<a>
tag with the Twig variable we set for the link. So this line should be:Same goes for the rest of the link replacements. See the original patch (in issue summary) for reference as well.
Comment #7
smustgrave CreditAttribution: smustgrave at Mobomo commentedSorry about that!
Comment #8
Amber Himes MatzNit. Let's retain the italics on this link for consistency's sake. (So, wrap
{{ library_link }}
in<em></em>
tags.Otherwise, looking good.
Comment #9
asad_ahmed CreditAttribution: asad_ahmed at OpenSense Labs commentedMade changes as per #8. Please review. Thanks
Comment #10
Amber Himes MatzThanks for the patch addressing my nit-pick @asad_ahmed. I've since realized that the "italics on links" nit-pick is actually an issue onto itself or something better handled in #3121340: Fix up minor copy problems in help topics (because it applies to many links in many topics and is a Help Topics Standards issue). It also creates a tiny bit of a rabbit hole here in this issue because of the extra whitespace between the em tag and the opening double-curly braces in your patch. So while I really appreciate your time and work on creating an updated patch, I'm going to go with the patch in #7 and ignore the italics-nit-pick until it is addressed in #3121340: Fix up minor copy problems in help topics. That's why I'm removing credit here.
@smustgrave Thanks for the patch in #7.
I tested using the following steps:
For each of the help topics in this patch, all of my tests passed. Because of that, this (patch in #7 looks good to me.
Comment #12
alexpottCommitted and pushed bc9e8b0749 to 10.1.x and ab6c8b10a8 to 10.0.x and f62119a728 to 9.5.x. Thanks!