Problem/Motivation
#3041924: [META] Convert hook_help() module overview text to topics for the file, image, media, media_library, responsive_image module(s).
Proposed resolution
Take the information that is currently in the hook_help module overview section for the module(s), and make sure the information is in one or more Twig help topic files. Steps:
- Find the hook_help() implementation function in the core/modules/MODULENAME/MODULENAME.module file(s). For example, for the core Contact module, the module files is core/modules/contact/contact.module, and the function is called contact_help().
- Locate the module overview portion of this function. This is located just after some lines that look something like this:
switch ($route_name) {
case 'help.page.contact':
And ends either at the end of the function, or where you find another case 'something': line.
- We want to end up with one or more topics about the tasks that you can do with this module, and possibly a section header topic. So, read the help and figure out a good way to logically divide it up into tasks and sections. See Standards for Help Topics for information on how to do this.
- See if some of these tasks are already documented in existing topics. Currently, all topics are in
core/modules/help_topics/help_topics. Note that to see existing topics, you will need to enable the experimental Help Topics module (available in the latest dev versions of Drupal 8.x).
- For each task or section topic that needs to be written, make a new Twig topic file (see Standards for Help Topics) in
core/modules/help_topics/help_topics. You will need to choose the appropriate module prefix for the file name -- the module that is required for the functionality. Alternatively, if the information spans several modules or if the information should be visible before the module is installed, you can use the "core" file name prefix. For instance, it might be useful to know that to get a certain functionality, you need to turn on a certain module (so that would be in the core prefix), but then the details of how to use it should only be visible once that module is turned on (so that would be in the module prefix).
- File names must be MODULENAME.TOPICNAME.html.twig -- for example, in the Action module, you could create a topic about managing actions with filename action.managing.html.twig (and "MODULENAME" can be "core" as discussed above).
- Make a patch file that adds/updates the Twig templates. The patch should not remove the text from the hook_help() implementation (that will be done separately).
Remaining tasks
a) Make a patch (see Proposed Resolution section).
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. The topics are files in the patch ending in .html.twig. If you find a 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.configuring within 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
Help topics will be added to cover tasks currently covered in modules' hook_help() implementations.
API changes
None.
Data model changes
None.
Release notes snippet
None.
Comments
Comment #2
james.shee commentedComment #3
james.shee commentedFirst pass, converted the whole media_help function into help topic twig template
Comment #4
benjifisher@James.Shee:
Thanks for starting this!
There is some inconsistency there with white space: we should get rid of the space after some of the opening parentheses (
().This is the first time today I have seen the third parameter to the Twig
url()today.I think we should get rid of a lot of the white space. (This line is just an example.) Keep the space after
{{and{%and before%}and}}, but not before and after the HTML tags and within the translation directives.\ No newline at end of fileAccording to the Drupal coding standards,
See if you can configure your text editor/IDE so that you do not have to think about this ever again. For example, if your editor/IDE respects the EditorConfig standard, then Drupal's
.editorconfigwill automate some of these standards.Comment #5
kkalaskar commentedComment #6
kkalaskar commentedComment #7
kkalaskar commentedPrevious patch (#5) was wrong. Adding new one.
Comment #8
jhodgdonWe need to postpone this until the #2920309: Add experimental module for Help Topics gets committed. No idea when/if that might happen right now...
Comment #9
chr.fritschUnblocked
Comment #10
jhodgdonAdding more media-related modules to this issue, so it will need more in the patch (have not reviewed the existing patch yet).
Comment #11
jhodgdonUpdated issue summary with better instructions/guidelines
Comment #12
jhodgdonAnd one more iteration on the guidelines.
Comment #13
jhodgdonWe've migrated the help topic standards to https://www.drupal.org/docs/develop/documenting-your-project/help-topic-... so updating issue summary again.
Comment #14
volkswagenchickTagging this for badcamp2019. (October 2-5)
Comment #16
jhodgdonWe just found out that all topic Twig files currently need to go into core/modules/help_topics/help_topics (with their finalized module-based file names), for the time being until the Help Topics module is stable. Updating issue summary. Patch will need to be updated too.
Comment #17
jhodgdonComment #18
jhodgdonI think we should probably postpone this issue until #3087562: Convert datetime, datetime_range, field, field_ui, link, options, telephone, text modules hook_help() to topic(s) is finished, because that module is providing an overview topic that talks about fields, which I think this issue will need to either add to or reference or both.
Comment #19
jhodgdonStill postponed.
Comment #20
jhodgdonThe field/entity issue was committed, so this does not need to be postponed any more!
Comment #21
jhodgdonThe patch in #7 is basically a cut/paste of the existing hook_help for the media module, so I don't think it's a very useful starting point.
So, I'm trying to figure out what topics we actually need for this set of modules. Some thoughts:
a) It seems like we want to recommend using the Media module fields (which are Media Reference fields), rather than File or Image module fields, on content types. We already have "Reference" fields listed as a field type on core.content_structure topic, and Media listed as a content entity type in that topic.
b) We probably need a topic called "Managing media", which would be related to core.content_structure, and probably it would be an overview top-level topic. In this area, we need to cover:
- What is media? (images and other files)
- What is a media library?
- What the various modules do
- How to set up a media field and the media library (if it's different from adding a reference field in general; otherwise just link to the field_ui.reference_field topic that already exists)
- How to set up an image style
- How to set up responsive images
I'll work on writing these topics
Comment #22
jhodgdonHere is a start of a patch. It still needs some topics to be written. I'm unassigning this for the moment; will get back to it in a day or two if no one else does.
Comment #24
jhodgdonI did some more work on this patch, but when I got to the topic about responsive image styles, I realized it needed to refer to help on breakpoints in order to continue. So, I think we should postpone this issue until #3055055: Convert appearance-related modules: breakpoint, color, layout_builder, layout_discovery module hook_help() to topic(s) is done.
I did manage to get part of that topic written, as well as the topic about image styles, so I'm uploading my partially-done patch in the meantime.
Comment #25
jhodgdonThis does not need to be postponed any more, as the blocking issue is now fixed. I'll make a new patch in the next few days.
Comment #26
jhodgdonTaking the Novice tag off this issue. It really isn't, at least until we get to the review stage.
Comment #27
jhodgdonI made a patch for this, now with all the topics. Ready for review! Adding back the Novice tag and Global2020, as a review (following instructions in the issue summary) would be the next step.
Comment #28
mfv commented#27 Patch Installed with no issues.
Here are some of my findings:
image.style.html.twig:
Instructional text suggestions:
5. Configure the effect on the next page, this applies to most effects. For example, for the Crop effect, enter the Width and Height to crop the image to, and choose the Anchor point. Click Add effect.
7. Drag to change the order of the effects, if necessary. Then click Save to save the new order.
8. The image style can now be used to format a field containing an image, in your layouts or traditional field displays. It can also be used as part of a responsive image style. See related topics below for more information.
core.media.html.twig
twig:
line 15: "<p>{% trans %}The media library is a visual user interface for managing media items and reusing them in Media reference fields, via the Media library field widget.{% endtrans %}</li>" needs a closing </p> tagComment #29
jhodgdonThanks for the review! Setting this to Needs work accordingly.
Comment #30
ashishdalviComment #31
jhodgdonPlease don't remove previous event tags when adding new ones, thanks!
Comment #32
ultrabob commentedComment #33
ultrabob commentedI'll try to move this one forward. I'm in #contribute on drupal slack while I work on this for #Global2020
Comment #34
nuklive commentedI'll be reviewing ultrabob's patch
Comment #35
ultrabob commentedI've addressed the issues raised in the review of 27, with some minor edits that I think make the text read more clearly.
Comment #36
ultrabob commentedOne of my changes somehow got left out of the previous patch, so I'm redoing it.
Steps to test: enable experimental help topics module and the media module, then visit
/admin/help/topic/image.styleand/admin/help/topic/core.mediato verify.Comment #37
nuklive commented1) Patch applies cleanly to 9.1.x.
2) Following the instructions to test the patch I was able to access the new help topic pages
3) I verified that the text is simple and understandable, links work and the instructions are clear, English is my second language, so I checked grammar/punctuation errors with a spellchecker
Comment #38
jhodgdonThanks for the review! Looks good to me too. Based on reviews of @nuklive and @mvf (whose comments have been addressed), I think we can set this to RTBC now.
Comment #40
jhodgdonUnrelated fail:
Drupal\Tests\media_library\FunctionalJavascript\WidgetUploadTest::testWidgetUploadAdvancedUi
"image-1.png" not found
Comment #42
jhodgdonUnrelated fail in Drupal\Tests\quickedit\FunctionalJavascript\QuickEditIntegrationTest
Comment #43
catchWe shouldn't use 'entity sub-type' here - it's not used in core, and there are old core issues to introduce the concept (differently to bundles) - would either remove the parenthetical altogether, or change it to 'bundles'.
Separately - do we have twitter support in core? If not I don't think we should list it.
I scanned over this sentence too quickly, and it read like I should use the media reference field instead of the media reference field - could we re-order - like 'You should normally use the media reference field instead of image and file fields'?
Comment #44
jhodgdonThanks for the review!
If we're not using the terminology "entity sub-type", what are we using? If there is an alternate terminology that is better, we need to update the already-committed core.content_structure topic (which is referenced here for this terminology), and anywhere else in other existing topics that uses this terminology. Also the User Guide, which also uses this terminology. For now, let's punt this terminology question to #3121340: Fix up minor copy problems in help topics.
So, we need a patch that:
(a) removes mention of Tweets
(b) rearranges the confusing sentence
in the core.media topic (see previous comment for details).
Comment #45
ultrabob commentedOK, let me try to get that done.
Comment #46
ultrabob commentedI made the suggested changes, and then went ahead and did some more simplifying and readability editing on the text. I also shortened the long lines of text into manageable chunks in the source. I probably should have done that with the other files too.
Comment #47
jhodgdonPlease reverse those changes. These are translatable strings, and having them broken up into lines is actually not helpful. It also makes the interdiff very difficult to review. So, if you could please make another patch with all the single-text strings in single lines again, and make an interdiff from the previous patch, that would be helpful. Thanks!
Comment #48
catchOne of the related issues: #1380720: Rename entity "bundle" to "subtype" in the UI text and help.
IMO we should just use 'bundle', unless we rename bundle to something else. But 'entity sub-type' is not self-explanatory to me, so it's really adding an additional concept on top of bundle for people to understand, as opposed to explaining what a bundle is.
Comment #49
jhodgdonOK I'll link that on the other issue, but we already have a number of topics... We would either have to use the term "bundle" and explain it, or use the term "entity sub-type" and explain that. New users of Drupal do not understand either "entity" or "bundle" or "type and sub-type". Again, let's for now be consistent within the topics (and the user guide) and fix it at the end in all the topics, not hold this issue up on something that was already done.
Comment #50
ultrabob commentedSorry about the formatting thing. I've reverted that, fixed a typo, and also removed the parenthetical about entity sub-type because I tend to agree that it isn't adding much besides establishing the phrase "entity sub-type" for the Related Topics list at the bottom.
I thought that alternately, that sentence could be phrased as something like
to kind of define entity sub-type inline there.
Comment #51
jhodgdonHere's an interdiff between the patch in #36 and the patch in #50. I took a look at that interdiff, and have the following comments, all related to the one file that was changed (core.media.html.twig):
a) Nitpick: please only 1 space after a . Occurs in several places throughout this interdiff.
b) Nitpick: I don't think media should be capitalized here: "Core Media items ..."
c) As noted in #44, the already-existing topic on content structure, which is referenced/linked in this topic, already uses the terminology of entity sub-types, and I've added a to do to #3121340: Fix up minor copy problems in help topics to revisit that decision. The decision will also be discussed on #1380720: Rename entity "bundle" to "subtype" in the UI text and help (and it looks like "sub-type" is likely to be the decision there]. Until that happens, we should continue to use the terminology so that the entire set of help topics that deals with content entities is consistent.
d) Nitpick: please remove the blank line in the template here:
Comment #52
jhodgdonThe "entity sub-type" terminology has been agreed to at the Usability group meeting, on #1380720: Rename entity "bundle" to "subtype" in the UI text and help.
Comment #53
ultrabob commentedI don't know when or if, I'll find time to make another patch for this, but to clarify on the new agreement on subtype, are you now suggesting that sentence should read something like:
?
Comment #54
jhodgdonI suggest we go back to the wording in the patch in #36: "Media items are content entities, and they are divided into media types (which are entity sub-types);..."
Comment #55
shetpooja04 commentedI have uploaded the patch with the changes suggested in #51
Please review, Thank you
Comment #56
jhodgdonLooks good to me! I think the concerns in comments 43-52 have been addressed, given that the decision on #1380720: Rename entity "bundle" to "subtype" in the UI text and help from the Usability team is that we should keep the "entity sub-type" terminology that is already in place on the content structure topic (and not use the term "bundle").
Thanks for the patches!
Comment #59
jhodgdonQuickEditIntegrationTest again. But why is the patch on #50 instead of #55 being tested regularly???
Comment #60
jhodgdonThat comment seems to have reset the bot, so the correct patch should be retested now.
Comment #61
jhodgdonThis should not really be a Novice issue
Comment #63
catchCommitted 40887e9 and pushed to 9.2.x. Thanks!
Comment #65
catchAnd cherry-picked to 9.1.x