Problem/Motivation
On #3041924: [META] Convert hook_help() module overview text to topics we are creating new help topics, and on #3041928: ISSUE TEMPLATE -- Do not edit -- template for making child issues we came up with some standards for help topics on https://www.drupal.org/docs/develop/documenting-your-project/help-topic-...
We need to go back to the topics that were created before the standards were in place, which are located in core/modules/help_topics/help_topics, and make sure they adhere to the standards. I don't think they do currently, so they will need some updates. Some of them also need to be removed if they are empty.
Also, we need to take special care to make sure that the topic titles are unambiguous for translators. Titles like "Shortcuts" and "Contextual links" are less good than phrases like "Managing shortcuts" and "Using contextual links".
As a note, I think we should NOT update any topics in core/modules/help_topics/tests, because these are used for testing and they don't really need to adhere to the standards (it would most likely require changing the tests too if we did change them).
I'm copying in the relevant portions of the issue summary on the template issue, so that we have the review instructions here.
Proposed resolution
Update the previously-written topics in core/modules/help_topics/help_topics so that they adhere to the help topic standards, which are listed on https://www.drupal.org/docs/develop/documenting-your-project/help-topic-...
Here is a list of the updates.
Stub pages added
The following stub pages are added, because other topics need to link to them, and the issues where those topics will be written fully:
- block.overview.html.twig #3047709: Convert block and block_content module hook_help() to topic(s)
- node.create_content.html.twig #3067727: Convert comment, node, path, taxonomy module hook_help() to topic(s)
- system.extend.html.twig #3041926: Convert automated_cron, ban, dblog, syslog, system, update, and user module hook_help() to topic(s)
- user.permissions.html.twig #3041926: Convert automated_cron, ban, dblog, syslog, system, update, and user module hook_help() to topic(s)
Pages deleted
The following pages were deleted:
- core.maintenance.html.twig (was pretty-much empty)
- core.menu_overview.html.twig (was pretty-much empty)
- help.writing.html.twig (belongs on drupal.org docs not here -- not for site builders -- see https://www.drupal.org/docs/develop/documenting-your-project/help-topic-... instead)
Pages updated
The following pages were edited to conform with the standards (some of them had their file names changed, so they might appear in the patch as a delete and a new file):
- core.ui_contextual.html.twig -> contextual.overview.html.twig
- core.ui_tours.html.twig -> tour.overview.html.twig
- shortcut.ui_shortcuts.html.twig -> shortcut.overview.html.twig
- core.config_basic.html.twig -> system.config_basic.html.twig
- core.config_error.html.twig -> system.config_error.html.twig
- core.security.html.twig
- core.ui_accessibility.html.twig
- core.ui_components.html.twig
- user.security_account_settings.html.twig
Test updates
The following updates were made to tests:
- HelpTopicTest.php: Took out the section that verifies that some production topics cannot be seen when their modules are off. This test is not really maintainable as we add/delete/edit topics (we shouldn't have tests that depend on particular production topics being there).
Remaining tasks
a) Make a patch.
b) Review the patch:
- Apply the patch.
- Turn on the experimental Help Topics module in your site, as well as the module(s) listed in this issue.
- Visit the page for each topic that is created or modified in this patch (see Proposed Resolution section above for the list). The topics are files in the patch ending in .html.twig. For each such file, such as core/modules/help_topics/help_topics/action.configuring.html.twig, you can view the topic at the URL
admin/help/topic/action.configuringwithin your site. - Review the topic text that you can see on the page, making sure of the following aspects:
- The text is written in clear, simple, straightforward language
- No grammar/punctuation errors
- Valid HTML -- you can use http://validator.w3.org/ to check
- Links within the text work
- Instructions for tasks work
- Adheres to Standards for Help Topics [for some aspects, you will need to look at the Twig file rather than the topic page].
- Read the old "module overview" topic(s) for the module(s), at
admin/help/MODULENAME. Verify that all the tasks described in these overview pages are covered in the topics you reviewed.
User interface changes
Older help topics will follow the new standards, and empty ones will be gone. Some stub pages will be added (to be written later) because they need to be linked to.
API changes
None.
Data model changes
None.
Release notes snippet
None.
Note for committers:
It might be nice for this patch to get into the potential Beta release of Help Topics. It will provide a nicer list of topics for the initial beta launch than what is in there now. As of 22 October 2019, I think Help Topics was removed from 8.8.x at Alpha, and I'm not sure, if it gets put back in before 8.8.0 is released, where it will come from (is it just copied from the latest 8.9.x branch?)... but anyway it would be useful for this patch to be in the Beta release of Help Topics if possible.
| Comment | File | Size | Author |
|---|---|---|---|
| #51 | interdiff-50-51.txt | 1.89 KB | amber himes matz |
| #51 | 3072312-51.patch | 40.09 KB | amber himes matz |
| #50 | basic-site-settings-after.png | 74.16 KB | jhodgdon |
| #50 | admin-help-after.png | 9.84 KB | jhodgdon |
| #47 | coming-soon.png | 103.5 KB | webchick |
Comments
Comment #2
jhodgdonOn #3065148: We need less ambiguous help topic labels we also discussed that topic titles need to be unambiguous for translations. If we follow the standards we have set out here, they will be, but I'm adding a note to the issue summary about it anyway. (That issue has been closed as a duplicate of this one.)
Also getting the latest standards from the parent issue template.
Comment #3
jhodgdonWe've migrated the help topic standards to https://www.drupal.org/docs/develop/documenting-your-project/help-topic-... so updating issue summary.
Comment #4
jhodgdonI have some time to work on this in the next few days.
Comment #5
jhodgdonHere is a patch.
- I removed a few topics that were empty. If we have content we can add them then.
- I added some "stub" topics that we need to write.
- I moved topics to more appropriate locations (module directories). Tried to move some to core/help_topics but that didn't work (see bug report).
- I removed the writing good help topic. We have a help topic standards page on drupal.org that tells how to write good topics, but this topic is not really needed by site admins. I added one note to that page that wasn't there from the topic.
Comment #7
jhodgdonOn #3076348: Refactor help topic tests so they do not use production topics, we mostly refactored the tests so that they did not depend on production topics. But not the part in the Functional HelpTopicsTest that was testing that if you put topics in the help_topics directory inside core/module/help_topics, and they are intended for modules that are not enabled, the topics are not shown. (That is the test fail from the previous patch.)
To make the test pass, the best thing to do is add the code/test patch that was supposed to be on #3025577: Move help topics to core or the correct modules into this patch. So, here's an interdiff and code change (1-line code change and a few lines removed from a test), added to the patch that was in the previous comment.
Comment #8
jhodgdonupdating title/summary
Comment #10
andypostReroll & fix meta dm
Comment #11
andypostremoval of missed files, proper re-roll
Comment #14
jhodgdonI think probably all of the test fails were due to a discovery exception:
Due to this code change:
But this is not currently working due to this related issue.
So I think we need to fix that one first, and this one should be postponed for the moment.
Comment #15
jhodgdonSorry that was a bit confusing.
We don't want the core help topics in the core/modules/help_topics/help_topics directory. We want them to be under core/help_topics. Which is why that line of code in the comment above was added to the patch in #7.
But due to #3079810: core/help_topics directory does not work, actually moving the help topics to that core directory is also not working. So we need to:
- fix that issue
- move the core topics out of core/modules/help_topics/help_topics and into core/help_topics.
Comment #17
jhodgdonI asked in Slack and found out from @xjm that all of the code *and topics* related to the Help Topics module need to stay under core/modules/help_topics until we are Stable.
So, I reopened #3025577: Move help topics to core or the correct modules (which had been part of this issue), and let's make this issue just about review/fix/delete topics and leave the move until later. As such, it does not need to be postponed. Updating summary.
Comment #18
jhodgdonIn light of #17, here is a reroll of the previous patch (#11), which does the following:
a) Moves all the help topics back to core/modules/help_topics/help_topics.
b) Removes the code change from HelpTopicDiscovery and instead leaves it unchanged:
we still need this code, because everything is staying in core/modules/help_topics/help_topics for now.
I haven't made any other changes. I didn't think an interdiff was useful... Let's see what the bot thinks.
Comment #20
jhodgdonOK! That went well. We are down to one test fail:
Hm...
That is from this section of the file:
This is a list of the variables you can use in setting up automated email messages. I actually don't think those should be translated. So maybe we need a way to put exceptions into the syntax checking test? Trying this...
Comment #22
jhodgdonWell, that didn't work. I'll need to get onto the machine I actually use for development and figure this out more. Also probably if I make an addition like this to the syntax test, the test cases should be updated to put in a case like this with not-to-be-translated text to verify it works, and also a Twig comment.
Comment #23
jhodgdonStill need to do #22. Meanwhile, I added a summary of what the patch will do and/or does to the issue summary, because the patch itself is a bit confusing (looks like it is deleting files when it is not necessarily doing so, because they changed names and also got edited).
Comment #24
jhodgdonOK, a few more updates:
- Removed the "Writing good help" topic, as discussed on comment #5 (that removal got reverted by mistake in one of the other patches).
- Fixed some files that failed the syntax tests locally.
- Fixed the syntax test so it actually works for Twig comments and for designating parts of a file to be OK to be untranslated.
- Added these items to the test topics so that the test will continue to work for them hopefully.
Test passes locally now. Probably time for the topics text to be reviewed (assuming the bot agrees)?
Comment #25
jhodgdonI had second thoughts about this patch. I think I will rewrite that one topic so that it doesn't need the "designate parts of a file to be OK to be untranslated" thing, and take that out of this patch.
Comment #26
jhodgdonHere's a new patch, which rewrites one topic and removes the test update that added that functionality (see previous comment). Updating issue summary to reflect this simpler patch. Syntax test still passes locally.
Note: If you want to review this patch (thanks!), check the issue summary for a list of topics that are in this patch. The patch file is itself a bit confusing, with some topics looking like they were deleted/added instead of modified (due to large changes and new file names). Anyway... the thing to do is probably to review all the topics that are visible now on admin/help, and the ones they link to.
Comment #27
jhodgdonNote to potential committers: It would probably be nice to get this backported to 8.8, because it will improve the UX of the (hopefully beta) experimental Help Topics module by making better topics available when people first see it in a release. Hm... Although I think help_topics is cut out of 8.8 at the moment. Not sure where the module that would get put back in will come from... Anyway I'll add a note to the issue summary.
Comment #28
jhodgdonI talked to Amber about this patch today. We decided it would be good to rename the "stub" pages so they start with "Coming soon", to make it clearer to users of Help Topics that this is a work in progress.
Also adding links to the issue summary to the issues where those particular stub topics will be worked on.
Comment #29
amber himes matzMy 1 concern is about core.security.html.twig.
1. It's basically a stub, but isn't labeled as such. Granted, it's a bit more filled out that the other "coming soon" stubs, but I wouldn't consider this a completed topic at the moment.
2. It's not obvious to me why the user.security_account_settings.html.twig lists core.security as related. This could be alleviated by an explanation under the heading "Security tasks" in the core.security topic. (Our standards say "1-3 sentences describing the tasks related to this section, ending with this sentence: "See the related topics listed below for specific tasks."")
3. To make core.security complete, we should add information about navigating to the appropriate Reports page to see if there are security updates available for your site and link to the User Guide chapter on this topic. We should also add the 1-3 sentences describing tasks related to this section. (See #2.)
4. Maybe create a new follow-up issue to create "task" topics under the core.security section topic.
Comment #30
amber himes matzI am working on a patch to address my concerns in #29. (Removing the related topic core.security from user.security_account_settings and adding additional resources to the core.security topic as well as further explanation in the overview paragraph, as per our standards.
Comment #31
amber himes matzThere's also a stray
<meta>tag in core.ui_components that I will refactor to use the new front matter format in my patch as well.Comment #32
amber himes matzNew patch and interdiff.
I realized looking at the proposed outline for organizing help topics that in fact the configuring user account topic is organized under the making your site secure topic. Which in context with the other related security topics, makes sense to me. (See #2687107: Reorganize topics into sensible outline, and/or write more topics.) So, disregard my point #2 in comment #29.
1) This patch more or less completes the "making your site secure" topic, so that it doesn't resemble a stub or WIP. I added some text using our standards as a guide and also added relevant User Guide links.
2) Refactored an HTML meta tag in core.ui_components to use the proper front-matter syntax.
3) Fixed a spelling error/typo.
4) The main outstanding question I have is regarding the proper Twig syntax for linking to external URLs and translating the linked text. Currently, we are using HTML anchor tags inside
and
<li>{% trans %}A menu system, which you can navigate to find pages for administrative tasks. The core Toolbar module displays this menu on the top or left side of the page (right side in right-to-left languages). There are also contributed module replacements for the core Toolbar module, with additional features, such as the <a href="https://www.drupal.org/module/admin_toolbar">Admin Toolbar module</a>.{% endtrans %}</li>Is this linking convention correct and proper? I had trouble finding examples in docs, specifically about external URIs.
Comment #34
amber himes matzForgot to wrap new text in trans/endtrans Twig tags in core.security topic. New patch and interdiffs.
Comment #35
amber himes matzComment #36
andypostI'm sure translation system will complain about HTML-markup used in translatable strings
Comment #37
jhodgdonWe have many examples of using HTML A tags inside translated strings. That should not be a problem.
The interdiffs look great! I do have one concern:
The following Drupal 8 User Guide chapters provide guidance...Actually, these are not chapters but topics within User Guide chapters... But maybe rather than linking to 5 topics all within the security chapter of the user guide, we should just link to the whole chapter? https://www.drupal.org/docs/user_guide/en/security-chapter.html That way if we add new security topics there, going forward, they would still be included... Seems better than making 5 links to me. Thoughts?
Comment #38
jhodgdonA note about my assertion about A tags within translated strings -- I went to localize.drupal.org and searched for strings containing "https:" in the translation sources. There were 2 pages of results in Drupal Core 8.7.8, so this is definitely the right pattern. Here are a couple of examples:
etc.
Comment #39
jhodgdonActually though, there is a problem. Take a look at #36. I think the endtrans needs to be outside the end of the A tag, not inside the A tag! Either that or the start trans tag needs to be inside the A tag, so it is only wrapping the link text.
Comment #40
andypostCommented in slack but better to beware markup in translation because of https://api.drupal.org/api/drupal/core%21modules%21locale%21locale.modul...
Comment #41
amber himes matzThanks for the feedback and the error catch!
I think it's a good suggestion to link to just the security chapter in the User Guide. I replaced the multiple links with the 1 link to that chapter. I also removed the explanatory sentence about as I think it speaks for itself.
Maybe follow-up issue: Should we add a test for making sure tags that are opened within a Twig
{# trans #}tag are closed before the {# endtrans #} tag?New patch and interdiff.
Comment #42
amber himes matzRegarding #40, as far as I can tell, the PODatabaseWriter won't add the string to the translation database unless it passes the locale_string_is_safe test, which checks for certain tokens in allowed HTML tags. See https://git.drupalcode.org/project/drupal/blob/HEAD/core/modules/locale/...
Maybe a follow-up issue? We might want to add to our core/modules/help_topics/tests/src/Functional/HelpTopicTranslationTest.php to check for allowed HTML strings (going on the list in https://api.drupal.org/api/drupal/core%21modules%21locale%21locale.modul...).
Comment #43
jhodgdon#41 looks good to me. +1 for RTBC and for getting this backported to 8.8 if possible.
+1 for a follow-up issue that tests that the translated strings have valid HTML (and for a test case that doesn't, or that has a missing closing tag) to make sure that the test is valid. And I think regarding #40/42 what we should do is add a test that verifies that strings within the Twig trans tags pass locale_string_is_safe() [which is the same function in D7 and D8].
So, for these two things, I thought 1 issue was probably enough, and I made:
#3090257: Add additional tests for help topic syntax
and added this to the Roadmap issue.
Comment #44
amber himes matzThis is a case where we reviewed each other's contributions to the patch. So I’m also +1 to RTBC and will mark it as such.
Comment #45
amber himes matzIt would be ideal to have this committed and backported to 8.8 in anticipation of DrupalCon Amsterdam next week. @webchick mentioned in #3087027-10: [policy, no patch] Mark the help topics module as beta stability that it would be really good to have a better set of default topics, in order to put our best foot forward. This issue is a solid step in that direction.
Comment #46
andypostRTBC++
Comment #47
webchickHere is a before and after:
Pros:
- No more dead/misleading stub pages. Hooray!
- Most of the pages follow a consistent format like "Goals" / "Steps" / "Additional resources" / "Related topics" with actual stuff in those areas.
Here's a before/after example of said template usage:
Cons:
- We lost the links on the above screenshot for some reason?
- We're now basically exposing this initiative's "todo" list in the UI to site builders, which seems odd. (e.g. the "Coming soon" pages). And that would be one thing (say this were being done to line up dominos for sprinting at DrupalCon), but we're also exposing that we don't quite know what to do with it in the actual page text:
I'm guessing we're exposing that "Coming soon" stuff for a reason? If so, it'd be good to know what it is. This kind of "todo" stuff normally lives in code comments, pointing to an issue in the issue queue vs. shown to end users (we don't throw similar nomenclature into, say, Layout Builder's UI to indicate that we're planning to revamp the block listing in a later release).
So I guess I'd go back to my feedback in the original "make beta" issue, which is whether we can strip out these "stub" pages until they are ready. If we do that, the topics that remain here are minimal, but they all follow a consistent format, and we've removed inaccurate / empty pages from before, which is a big improvement.
Not bumping down to "needs work" but "needs review" to see what you feel about this feedback.
Comment #48
amber himes matzThanks for your feedback @webchick.
Regarding the stub pages with the coming soon titles...those are there for other topics that aren't "top level" to link to, otherwise they would be orphaned. I agree it's not ideal.
What we could do is mark all current topics that we have in our help_topics directory (there would be 10 after deleting the 4 remaining stubs) as top level and as we complete issues related to writing and organizing groups of topics (see #3041924: [META] Convert hook_help() module overview text to topics), we can reorganize change the hierarchy as appropriate. This would negate the need for stubs I think.
That's a good catch on the linking before and after. I think that's something we should clarify in our standards and be consistent with it. In any case, I'll go back through again and review with an eye toward consistency and adding links where needed.
Want to discuss this with @jhodgdon a bit more before proposing another patch.
Comment #49
jhodgdonGood points!
So I think we should revise the hierarchy so the Coming Soon pages are not top level -- just put them somewhere. We already have another issue about fixing up the hierarchy at the end, so we can do it as we go and/or review the topics at the end and not worry about it too much right now. #2687107: Reorganize topics into sensible outline, and/or write more topics
Regarding the links... We definitely want (I think?) the navigation to be consistent, and this format mirrors what we're doing in the User Guide -- but there we can't have links (it's not within a Drupal site). So... How about if we change the standards for Help Topics so that the final item in the navigation should be a link? Let's try that -- if we like it, we can update the standards.
I'm on the wrong machine here, so I'll add this comment and then make a patch and some screenshots, most likely before you two wake up (insomnia to the rescue!). :)
Comment #50
jhodgdonOK, here's the new patch.
I decided you're right, we probably don't need to have the stub pages there at all. There were no in-topic links, just thinking "We are talking about Blocks here, so we need to link to the eventual Blocks overview page". So... I went ahead and removed them.
The admin/help Help Topics section now looks like this:

I also added links to the navigation, where possible. So the basic site settings topic now looks like this:

As a note, as far as I know we don't have a viable way right now to make a link that is contingent on a module (and its routes) being defined, the way we did in hook_help [at least I don't think so? Do we need an issue?]. So I couldn't make every navigation thing into a link. But I put in what I could.
If we decide we like this... we should change our Help Topic Standards to say to make the last part of a navigation description into a link, but only if the module that provides the link is a dependency of the module the topic is in. Thoughts?
Comment #51
amber himes matzYes, this is much better! I like that we've eliminated the stubs/coming soon topics.
I was also thinking the same thing about linking the last part of the navigation instructions. +1 to this approach and to adding it to our Help Topics writing standards.
Also, +1 to a follow-up issue to make conditional-on-module-install links possible in topic plugins to avoid a regression in Help. (I have not done that.)
There was a 404 on the Admin Toolbar module link in core.ui_components.html.twig, which I fixed in the attached patch and interdiff. Otherwise, I think this is ready to go!
Comment #52
jhodgdonDoh! I thought I had clicked all the links, but obviously not! +1 for careful testing -- you rock!
I created an issue about the conditional URLs, and added it to the Roadmap:
#3090659: Make a way for help topics to generate links only if they work and are accessible
I've also updated the Help Topic Standards to say the last element of the navigation should be a link if possible. If we decide that is no good, we can always revert the change.
I am +1 for setting this back to RTBC.
Comment #53
amber himes matzOk, I think we can set this back to RTBC. (I think we've covered our review bases between jhodgdon and myself, looking at each others patches.)
I think this lays a good foundation for us to build on, especially in terms of the work ahead with writing help topics and converting module overviews in hook_help. Yes, it's a little bare-bones, but better that than some potentially misleading stubs.
This is ready for another look by a core committer, I think.
Comment #55
webchickAwesome, this looks like a big improvement, and although the resulting page is a bit barebones, the bones that are there look fabulous! :D
Committed and pushed to 9.0.x... and for some reason I can't commit to 8.9.x; 8.8.x and I have to run RIGHT NOW to get my daughter. :P Left a note in #contribute, I'll be back in a couple of hours (unless anyone else gets to it first.)
Comment #60
webchickOk, I think because of the file deletions, things got messy in my working directory, but this should work now.
REALLY committed + pushed to 9.0.x/8.9.x/8.8.x this time. Thanks!