Problem/Motivation
https://www.drupal.org/project/allowed_formats is popular module (over 50 000 reported installations on D9/D10), the main feature was added to core on #784672: Allow text field to enforce a specific text format, but missed the option to hide sometimes confusing "about text formats" link and associated guidelines.
Steps to reproduce
Proposed resolution
Remaining tasks
Postponed on #3505370: Remove 'filter tips' page and deprecate the long format API
- Decision: Should the option to hide happen on field or widget level
- update hook
- tests for update hook
User interface changes
API changes
Data model changes
Release notes snippet
Original post by Berdir
We've seen that case in production with contrib, you are then forced to pick a new format, I don't think that's very problematic. But yes, test coverage makes sense.
There's one thing I'm wondering about. Beside this feature, the allowed_formats contrib module also has settings to hide the lengthy text format explanations, a feature that we use often. I'm a bit unsure how to handle that, for now you'd still need to use the contrib module for that, so it would require a new major version with a (post) update function and just those two settings? definitely don't want to delay this issue even further, maybe a follow-up that would allow us to move those into the same minor version?
| Comment | File | Size | Author |
|---|---|---|---|
| #37 | filter-guidelines.png | 33.02 KB | idebr |
Issue fork drupal-3323007
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
larowlanComment #3
larowlanBlocked on parent
Comment #4
feyp commentedThe parent issue has been committed.
Comment #5
andypostnice idea! in D7 there was better_formats for that IIRC
Comment #6
ressaThanks for reminding me of the great Better Formats module @andypost. I see that it just got a new maintainer who wants to focus on getting it ready for Drupal 10.
Comment #7
berdirhttps://www.drupal.org/project/allowed_formats has had this feature for years, that's why I suggested to add it to core. We've only made that project half-obsolete now.
Comment #9
simeI thought I would have this problem, having just switched from
allowed_formatsto the new core feature. But for some reason filter tips are not showing for me on the form, just the discreet "About text formats" link.I'm not so sure how they are hidden now that
allowed_formatsis uninstalled. I thought it might be Gin's feature to hide help text, replaced with a (?) toggle. There is just an empty div.Comment #10
idiaz.roncero+1000 to this
Comment #11
eduardo morales alberti+1001 to this, but as @sime says filter tips are not showing on the form, just "About text formats" link.
We are also using Gin
Comment #12
dgsiegel commentedAs a workaround you can hide it with this CSS snippet:
Comment #15
plopescCreated MR to add the Hide Help and Hide Guidelines widget settings to core in a similar way as they are in Allowed Formats module.
Also added basic test coverage.
It will require some extra work, but let's use this initial approach to gather feedback and get the ball rolling.
Comment #16
smustgrave commentedThanks for picking this up!
So far seems good,
The new schema changes will require an update hook + tests
All the core text field config will have to be updated to include the new config
For the form I imagine it could go right under "Allowed text formats"
Comment #17
plopescThank you for your review @smustgrave!
I was waiting for approach validation before going farther.
Fixed the broken tests.
Regarding the form, the idea is to define the settings at widget level, like in allowed_formats module, not at field level. But this can be discussed if the field level approach is preferred.
Comment #18
sokru commented+1 for adding it on widget level, so its easier to make allowed_format contrib module obsolete.
Comment #19
mstrelan commentedAs well as providing options on each entity form display it might be nice to have a global option that sets this once everywhere. The widget configuration should probably then have options to either use the site-wide default setting, or explicitly hide/show the help and guidelines.
Comment #20
dqd@mstrelan was quicker :-) exactly what I wanted to add.
+1 for a parent global and child sub setting overriding the global setting. Users are used to this from other admin UI experience. We have it in URL alias pattern, in states like "published" (default and on each node) and many other corners.
Comment #21
samuhe commentedMR seems good.
+1 for having a global setting, overrideable on widget level.
Comment #22
longwaveIf we wanted a global switch should this be a permission (or pair of permissions) provided by filter.module?
Also, I've said this in other issues - checking a box to hide something feels the wrong way round, the checkbox should be checked if we are showing something.
Comment #23
w01f commented+1 to "Display tooltips" per longwave's suggestion - my preference would be off by default.
Comment #24
scotwith1t+1 here as well for off by default. i almost always end up hiding these.
Comment #25
kopeboyyep, +1 for hiding the long tips, would be nice to have a tooltip when hovering a (?)
Comment #26
mattdanger commented+1 to off by default as @longwave suggested
Comment #27
catchComment #28
catchComment #29
quietone commentedShall we postpone this on #3505370: Remove 'filter tips' page and deprecate the long format API?
Comment #31
poker10 commented#3505370: Remove 'filter tips' page and deprecate the long format API is in, so moving back to NW.
Comment #32
smustgrave commentedMay work on this at the airport
Comment #33
idebr commentedThe link 'About text formats' was removed from the TextFormat render element in #3505370: Remove 'filter tips' page and deprecate the long format API. Is there anything left to do here?
Comment #34
smustgrave commentedI never got around to looking at this :( but good question.
Comment #35
longwaveYep this is obsoleted by #3505370: Remove 'filter tips' page and deprecate the long format API which hides it permanently for everyone.
Comment #37
idebr commentedThere is still the filter guidelines when the Text Format does not use an editor: