Problem/Motivation
This is spun off from #2934860-13: Show field type descriptions when creating a new field.
File, Image, and Media entity reference fields are quite similar in some ways, but there is no clear documentation for users to understand what the differences are, and when each would be appropriate to use. Media needs to document this somewhere canonical.
Proposed resolution
Add hook_help() text to Media which explains the difference in the Help section of the admin interface, so that it can be easily referenced and linked to from elsewhere in the UI.
Remaining tasks
Write and wordsmith the documentation.
Put it in a patch.
Review the patch.
Commit it!
User interface changes
This will add text to /admin/help/media
and to the Add field form when a Media, Image, or File referencec field is selected.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#35 | interdiff-26-35.txt | 2.56 KB | marcoscano |
#35 | 2934885-35.patch | 10.99 KB | marcoscano |
#29 | Add_field___Site-Install.png | 76.54 KB | xjm |
#27 | form_help.png | 265.24 KB | chr.fritsch |
#26 | 2934885-26.patch | 11.27 KB | benjifisher |
Comments
Comment #2
benjifisherI will try an initial version of this.
Comment #3
benjifisherThe attached patch adds one item to the definition list:
It also adds an H3 and paragraph at the bottom:
One technical problem is the link ("Content > Media") in the definition item: the route is
views.media.media_page_list
, which does not work as an argument toUrl::fromRoute()
. So I used the constant string<a href="/admin/content/media">
. Is there a better way?Comment #4
benjifisherOnce #2934424: Media has no collection route is commited, I think we can fix the technical point I raised in my previous comment.
Comment #5
seanBIn the end, I think we want to replace File/Image fields, so media would then be the only available option. We could slightly change the title. Besides that, this partly explains the uses of the module. There is already a separate heading for that. We might want to focus the extra chapter on the differences between media, file and image and move the usage explanation to the existing 'uses' section top.
Here is an updated proposal:
For the uses section:
and
New chapter:
Comment #6
benjifisherThese are good points. I kept the mention of additional fields short, since it is already mentioned in the "Uses" section. Maybe the repetition is useful here, since people will not always read the entire page.
How about putting the item on reusability before the item on fieldability?
Comment #7
phenaproximaI would refrain from mentioning this until #2831944: Implement media source plugin for remote video via oEmbed actually lands. :)
Comment #8
xjmNice, these docs are helpful.
Some initial review:
I would say "Adding media to other content".
Let's specifically say which the "appropriate permissions" are here. Maybe:
Minor nitpicks: "Media", "File", and "Image" should each by capitalized, and there should be a comma after "File".
I would use a definition list (
<dl>
) instead of a<ul>
. (I think nesteddl
are valid markup; if not, disregard this point.) :)Comment #9
starshapedUpdated help text documentation with suggestions made by @xjm in #8. Items 1, 2, and 3 have been updated, but I'm holding off on item 4 as a
<ul>
may make more sense in this context.Comment #10
benjifisher@xjm, thanks for the review in #8.
#8.3 The existing text on
admin/content/media
capitalizes "Media module" but not "media item(s)", "media type(s)", nor "media source". The existing text does not refer to "[Mm]edia field(s)" nor "[Mm]edia reference(s)".#8.4 If you want a definition list (
<dl>
) instead of an unordered list, what are you suggesting for the definition terms (<dt>
elements)? I do not think this list is nested, so that seems like a non-issue.Comment #11
xjmRe-read this; I think we can actually simplify it a lot:
Note that I've made the bullet about remote media more generic since core doesn't support remote media yet.
We should also add what File and Image references are useful for in a paragraph after the list:
Re: #10:
For this one, I've capitalized them only where they refer to the actual user interface labels for the field types (vs. the generic plural nouns). So just in that one place. (We should also add a couple
<em>
tags as in the rewrite above for that reason.)Agreed on not adding the nested
<dl>
; when I re-read it became clear that a<ul>
is totally correct here.Thanks!
Comment #12
xjmBased on this, I think we can potentially add a
case entity.whatsit.add.field.route
tomedia_help()
(if we can figure out a way to only display it when the user has selected file or image or media...) that says:That can be a followup, since it might require some tricky JS or whatnot for revealing the help conditionally. Said followup might be a simpler interim fix than #2934860: Show field type descriptions when creating a new field.
Finally, bumping this issue to major since it's probably a blocker expose Media in the UI.
Thanks!
Comment #13
xjmActually, the paragraph in #12 might be a better replacement for the other final paragraph I propose in #11, since it is more succinct and definitive.
Comment #14
marcoscanoHow about a good ol' form alter (in the media module, so only active if Media is enabled), that adds the help text indicated in #12 as a states-enabled description only to these 3 fields? If that is acceptable, I believe we can do that here, so no need for a follow-up.
I have also addressed the feedback from #11.
Screenshots are always good:
Hook help:
Other field types are not affected:
Help text added only when a user selects File, Image or Media references:
Comment #15
chr.fritschFound two minors:
We shouldn't use hardcoded URLs. Better call Url::fromRoute
Not sure if we could use Url::fromRoute here as well because the route might not exist.
Comment #16
marcoscanoThanks @chr.fritsch for reviewing!
This fixes #15.1.
For #15.2, I believe this can be an acceptable exception, because we are mentioning an URL that will only be available after the Help module is installed, so I'd rather not have a clickable link here.
Comment #17
benjifisherThe patch from #16 still contains the hard-coded path that I apologized for in #4. I think that will cause problems on multilingual sites that use a language code at the start of the URL path. So here is a version that uses
Url::fromUri()
with the use-only-as-a-last-resort schemeinternal:
.We can still update once #2934424: Media has no collection route lands. Is that worth a code comment?
Comment #18
xjm@marcoscano, great idea on the form alter hook; I think that's a completely acceptable implementation and it's no risk at all if we decide to change the approach later.
Good catch @benjifisher on the multilingual implications. Hopefully someone will take a look at #2934424: Media has no collection route. A
@todo
to remove theinternal:
is needed, I think.Some review:
If Media isn't installed, this hook won't be run, so I don't think we need this
else
. :)Same question here about the
toString()
.I think we can simplify this sentence to:
The
else
can be:I also think we shouldn't need the
toString()
; it should be stringcast automatically now (at least I thought we addressed that in the last few months of 8.0.0's beta). Please test and see if that works. :)Comment #19
xjmI don't think we should use the format "Content > Media" because that implies a menu link (there's not), the format might not be understandable, and site owners also might have put the page somewhere else. "The media administration page" might be a good replacement.
Comment #20
xjmFinally, we probably want a test asserting that the text shows for the file, image, and media references, but nothing else.
Comment #21
marcoscanoThanks @xjm for reviewing!
1.
This is supposed to deal with scenarios where the Help module isn't installed, is this a confusion or am I missing something?
2. The
::toString()
seems to be necessary, if it's not there we have:3. Fixed, although with a slight variation (maybe a copy-paste typo in the proposed text)?
4. Same as 2
Also, added a test!
Thanks!
Comment #22
benjifisherOnce again, I do the easy stuff: this time, adding the @todo in case #2934424: Media has no collection route does not get fixed before this issue.
Comment #23
xjmOops sorry, I thought I had deleted that bullet from my review. I had realized halfway through typing it that I was confused. :)
Nitpick "The" should not be ccapitalized inside this link since it's in the middle of a sentencec.
Comment #24
marcoscanoOps, sorry!
Comment #25
phenaproxima#2934424: Media has no collection route is in, so we should make sure we are using Url::fromRoute(). :)
Comment #26
benjifisherYay! Now I can remove the @todo that I added in #22 ... and todo it.
Comment #27
chr.fritschOn a widescreen, the description jumps to the right. Not sure if it is intended.
Comment #28
xjmJust realize the magic tag was missing.
Comment #29
xjmAdding the SS to the summary for the part that needs usability review.
Comment #30
xjmMaybe the form help text is easier to read in bullets?
Edit: another note for the usability reviewers: We currently have the same text on the selection of both Media fields and File/Image (because you need to know what your choice implies in either case). It's also possible for us to make the text different depending on the selection, if that would work better, but this is the best so far I think. :)
Comment #31
Gábor HojtsyI think having the same description for all three is fine. It is a bit long, but we need to explain the different choices somehow. The dropdown does not allow that, so we need a way to explain it. I have some comments on the text itself:
What about user profile pictures, let's say? :)
It looks strange to me to have this on a separate line. It makes it appear like a list (we don't do paragraphs in descriptions, so given its not running-on, it made me think of a list immediately). I would just keep the text running as one without the br.
Hm, I would *personally* not add this, it looks like overly fool-proof. Do we tell people elsewhere to enable the help module for help, or is that too obvious? :) No very strong feelings against it, but it looks very odd to me.
Comment #32
xjmThose should still eventually be stored as image media and just have access restrictions (and good defaults and etc.). Edit: which brings us back to the per-media type permissions issue which I forgot to add to the UX discussion aside from it being tagged in the RTBC queue. Will attach it in a moment.
Agreed. Or if anything the bit above it should be two bullets and this should be a separate paragraph.
How about the sentence is just added conditionally when Help is enabled, without the "enable the module" bit? Like remove the
else
entirely.Comment #33
xjmComment #34
xjmNW for #31 and #32.
Comment #35
marcoscanoHere we go!
Comment #36
Wim LeersComment #38
Gábor HojtsyHm, I did not expect profile pictures to be ideally media. Otherwise looks great. Thanks all!