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> &gt; <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> &gt; {{ 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/migrate_drupal_ui.upgrading.html.twig
  • core/modules/help_topics/help_topics/responsive_image.style.html.twig
  • core/modules/help_topics/help_topics/search.configuring.html.twig
  • core/modules/help_topics/help_topics/search.index.html.twig

Note:The search.overview help topic is being addressed in a separate issue because it has a sentence-embedded link.

2. Ensure that no other breadcrumb links need to be updated in migrate_drupal_ui, responsive_image, search.configuring, search.index -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.

CommentFileSizeAuthor
#2 3307697-2.patch8.52 KBquietone
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Amber Himes Matz created an issue. See original summary.

quietone’s picture

Status: Active » Needs review
FileSize
8.52 KB

All I did was extract the 4 files from the 9.5.x patch in the original issues. The patch applies to D10 as well.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed the text and makes sense to me.

Amber Himes Matz’s picture

Thank you for the patch, @quietone and the review @smustgrave!

1. Each link text in this patch matches the page title.
2. Each link text in this patch matches the menu item.
3. All files in the issue summary are included in this patch.
4. Each breadcrumb link in the files listed in the IS have been converted to use the new help_route_link() function.

+1 RTBC

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

I had some reservations about these patches but @catch and @Gábor Hojtsy pointed out that this improves the situation when we're not sure whether the current person reading the text will be able to click the link - and while this might make things worse for translators it improves usability.

Committed dadc672 and pushed to 10.1.x. Thanks!
Committed f13073a and pushed to 10.0.x. Thanks!
Committed 884d73a and pushed to 9.5.x. Thanks!

  • alexpott committed dadc672 on 10.1.x
    Issue #3307697 by quietone, Amber Himes Matz: Update breadcrumbs in...

  • alexpott committed f13073a on 10.0.x
    Issue #3307697 by quietone, Amber Himes Matz: Update breadcrumbs in...

  • alexpott committed 884d73a on 9.5.x
    Issue #3307697 by quietone, Amber Himes Matz: Update breadcrumbs in...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.