Problem/Motivation
When only one text format is available, the help link "About text formats" doesn't make much sense, since there is no manifestation of a text format in the UI that could need an explanation. See this screenshot from @LewisNyman (in the context of #784672: Allow text field to enforce a specific text format, which makes the situation of having just a single text format more common):
When only one text format is available, we should remove the link and well as the wrapper around it, not just the dropdown element as is currently the case.
Steps to reproduce
Proposed resolution
As suggested by Sam152 in #3 and supported by benjifisher in #33, Keep the link but change the label. That will allow someone to figure what they are allowed to enter in the field.
It might also be useful to add a test for this or add to some of the existing filter format tests?
Remaining tasks
Decide on text for the label when there is only one text format available.
User interface changes
TBD
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
Comment | File | Size | Author |
---|---|---|---|
#39 | After--patch--pic.png | 20.28 KB | vikashsoni |
#39 | Before--patch--pic.png | 17.85 KB | vikashsoni |
#36 | Screenshot 2021-05-19 at 14.43.42.png | 45.46 KB | Gauravvvv |
#36 | Screenshot 2021-05-19 at 14.32.24.png | 44.11 KB | Gauravvvv |
#35 | 2544188-35.patch | 1.18 KB | paulocs |
Comments
Comment #1
floretan CreditAttribution: floretan at Wunder commentedHere's a patch that hides the mention of text formats if only one is available:
Comment #2
floretan CreditAttribution: floretan at Wunder commentedScreenshots before patch:
Screenshots after patch:
Comment #3
Sam152 CreditAttribution: Sam152 commentedIs it possible the link is still useful but perhaps with a different label? How would someone figure out what they are allowed to enter in the field? If basic HTML was the only allowed format, what is available to tell me what that includes?
It might also be useful to add a test for this or add to some of the existing filter format tests?
Comment #6
swentel CreditAttribution: swentel as a volunteer commentedRelated - #2413335: Expose an option to hide the text format information of textarea fields (using a different technique there by using a new property for the text format)
Hiding by default makes sense too of course, there's little use for it, and the filter tips are usually more in the way then anything else.
Comment #8
jonathanshawA contrib solution is available in #2617982: Control "About text formats" link and inline text format guidelines
Comment #9
hchonovThis could be considered as a disruptive change and should be targeted against 8.2.x-dev and is a feature as well.
Comment #10
pguillard CreditAttribution: pguillard commented@floretan's patch at #1 still applies in 8.2.x branch, also screenshots at #2
Patch uploaded again for the bot.
Do we have some things to do there ?
Comment #11
hchonov@pguillard if you want to put a patch for retesting you have to click on the "Add test" link just under the patch and then there you the option to put the patch for retesting and do not need to upload it again.
Comment #13
jonathanshaw@floretan provided the patch in #8, so I think that is a much more up to date version of his work than #1.
Comment #14
hchonov@jonathanjfshaw from my point of view it is exactly the same file till the last bit, @pguillard just uploaded the same file again with mentioning it is for the drupal test bot. I've commented only to say that this was unnecessary as you can put an already uploaded patch for retesting.
Comment #15
radubutco CreditAttribution: radubutco commentedComment #16
radubutco CreditAttribution: radubutco commentedComment #21
leisurman CreditAttribution: leisurman commentedThis worked for me in drupal 8
https://www.drupal.org/node/2617982#comment-11908620
Comment #24
gordon CreditAttribution: gordon at Heydon Consulting commentedreroll for 8.6.x
Comment #25
gordon CreditAttribution: gordon at Heydon Consulting commentedI have made a change so that you can use a new attribute form text-format in the format api #format_hide and then when using textarea with formatting it will allow you to select if you want the issue or not.
This patch now relies on the #784672 patch.
Comment #32
quietone CreditAttribution: quietone as a volunteer commentedUpdate the IS.
I'm going to ask in #ux to find out if there are any problems with removing this link.
Comment #33
benjifisherI agree with @Sam152 in Comment #3.
Some text formats are boring, and there is not much to say.
Other text formats apply custom filters. As I write this comment, I do not have a choice of format, but if I follow the link, I find
I wish that more people knew about the filter for linking to issues. ;)
I think that changing the link text, as suggested in #3, is a good idea.
Comment #34
quietone CreditAttribution: quietone as a volunteer commented@benjifisher, thank you for the review. That gives this issue a way to move forward.
I have updated the IS and the title.
Here! Here! And it doesn't help that that information is at the bottom of a long page. At least, I now know where it is documented.
Comment #35
paulocsPlease let me know if my message looks good.
Comment #36
Gauravvvv CreditAttribution: Gauravvvv at OpenSense Labs commentedAfter patch #35, When only one format is available then, it is showing "About format and others formats."
When multiple formats are available then it is showing "About text formats"
Adding after-patch screenshots for reference. I think this is good to go. Can be move to RTBC.
Comment #37
quietone CreditAttribution: quietone as a volunteer commented@Gauravmahlawat, I think you missed reading the Issue Summary, the remaining tasks in the issue summary have not been met. This is not ready for RTBC.
@paulocs, thanks for the suggestion but I don't think referring to 'to other formats' when there is only one makes sense.
When I following that link the page title is 'Compose tip'. Maybe we just use that? Any other suggestions?
Comment #38
paulocsI understand the point about not add "to other formats" to the label. It makes really no sense.
"Compose tips" is good or maybe something like "Text format tips" would be good as well.
I will wait for a second opinion before write a new patch for it.
The patch should have tests as well, right?
Cheers!
Comment #39
vikashsoni CreditAttribution: vikashsoni as a volunteer and at Zyxware Technologies commentedApplied patch working fine
for ref sharing screenshot
Comment #40
thomasmurphy CreditAttribution: thomasmurphy at Xequals commentedMy UX take, for people entering data in a field which they
a) don't have permission to change field settings
b) don't understand what a text field is
This is an unactionable link, and therefore UX clutter. After the patch ideally there would be no text and no link. Happy to supply one if this is acceptable.
Comment #41
longwave@thomasmurphy as explained in #33 this link is still useful to provide text formatting tips, even when only one format is allowed.
The current patch doesn't use correct English grammar, and I'm not sure that showing the title of the single format is helpful to the user in most cases.
Maybe we can just use the wording "About text formatting" for all cases, which sidesteps the singular/plural issue entirely?