Update topic contact.setting_default to use route instead of "/contact"

Created on 5 May 2023, over 1 year ago
Updated 21 June 2023, over 1 year ago

Problem/Motivation

In 📌 Fix up minor copy problems in help topics Fixed , we collected a bunch of minor issues with help topics. It has been converted to a "plan" issue with separate issues created for each problem.

alexpott found this in contact.setting_default.html.twig

<p>{% trans %}Set a site-wide contact form to be the default contact form (the form that is shown on the <em>/contact</em> URL).{% endtrans %}</p>

It's possible the /contact path is altered so might not be on /contact. I think we should link to the site wide contact form using the contact.site_page route.

Additional notes (from #10):

1. The route to /contact (e.g. the default contact form page) is contact.site_page. We don't have Twig variables set up for that route yet. (Use the existing pair of Twig variables in this topic as a guide. Both the route and the link text will need to be updated.)
2. The Goal (the sentence we are updating with this link) need to be rephrased so that the link to the contact.site_page route can be added. It needs to be rephrased in a multilingual-context-friendly way. Since we won't know the title, this is tricky! Perhaps if we link the entire parenthetical phrase, that will work, because the entire context can be translated.

Steps to reproduce

  1. Install the latest version of Drupal
  2. Install Help Topics module, or if Help Topics has been merged with Help, install Help module.
  3. In a code editor or IDE, locate the help topic contact.setting_default.html.twig. (Since Help Topics is being merged into Help, and the core topics are being merged into their respective modules, it may be in 1 of several places:
    • core/modules/help_topics/help_topics
    • core/modules/help/help_topics
    • core/modules/contact/help_topics
  4. Looking at the Twig file (not in the UI), see if there are any mentions of the literal string /contact. Those should be replaced with the contact.site_page route using the help_route_link() function. As of the time of writing, there are already variables set up for this route, the variable just needs to be used to replace the remaining instance of "/contact".

Proposed resolution

Updated after review in #15.

The rendered HTML will be:

Set a site-wide contact form to be the default contact form (the form displayed on the default contact page; for example, /contact).

That shows that the URL might be /contact, but describes the page, just in case it isn't. And the whole phrase is linked, allowing for hopefully enough context for translators to make sense of it.

1. Add the following to the top of the file, above or below the current set of {% set %} statements.

{% set contact_page_link_text %}{% trans %}the form displayed on the default contact page{% endtrans %}{% endset %}
{% set contact_page_link = render_var(help_route_link(contact_page_link_text, 'contact.site_page')) %}

2. Update the paragraph immediately following the

Goal

heading to:

<p>{% trans %}Set a site-wide contact form to be the default contact form ({{ contact_page_link }}; for example, <em>/contact</em>).{% endtrans %}</p>

Remaining tasks

  1. Update contact.setting_default.html.twig per the proposed resolution.
  2. View the topic in the UI at admin/help/topic/contact.setting_default (you can use the Tugboat link in the issue to do this!) and verify the link to the default contact form in 2 places (the place you edited and the 2nd instance in the steps). (Note: Install Help Topics to see the change (or if Help Topics has been merged into Help, Help module))
  3. Make a patch or merge request. Note that this file may be in one of several places (see above), depending on the state of Help Topics' merge with Help.
  4. Review and approve
  5. Commit

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

The contact.setting_default help topic has been updated to reflect that the path to the default contact form will be at the configured contact.site_page route and not necessarily at the "/contact" path (which is the default). Uninstall and reinstall Help Topics module or Help (if Help Topics module has already been merged with Help) to see the change.

🐛 Bug report
Status

Fixed

Version

11.0 🔥

Component
Help 

Last updated 8 days ago

No maintainer
Created by

🇺🇸United States Amber Himes Matz Portland, OR USA

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024