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?

CommentFileSizeAuthor
#37 filter-guidelines.png33.02 KBidebr

Issue fork drupal-3323007

Command icon 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

smustgrave created an issue. See original summary.

larowlan’s picture

Title: Follow up to 784672 - add the 'hide filter tips' option like the contrib module » Add an option to 'hide filter tips' on text fields
larowlan’s picture

Title: Add an option to 'hide filter tips' on text fields » [PP-1] Add an option to 'hide filter tips' on text fields
Status: Active » Postponed

Blocked on parent

feyp’s picture

Title: [PP-1] Add an option to 'hide filter tips' on text fields » Add an option to 'hide filter tips' on text fields
Status: Postponed » Active

The parent issue has been committed.

andypost’s picture

nice idea! in D7 there was better_formats for that IIRC

ressa’s picture

Thanks 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.

berdir’s picture

https://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.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

sime’s picture

I thought I would have this problem, having just switched from allowed_formats to 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_formats is uninstalled. I thought it might be Gin's feature to hide help text, replaced with a (?) toggle. There is just an empty div.

<div class="js-filter-guidelines js-form-wrapper form-wrapper filter-guidelines" data-drupal-selector="edit-field-summary-0-format-guidelines" id="edit-field-summary-0-format-guidelines" data-once="filter-guidelines">
</div>
idiaz.roncero’s picture

+1000 to this

eduardo morales alberti’s picture

+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

dgsiegel’s picture

As a workaround you can hide it with this CSS snippet:

/* Hide text format help text */
.page-content .filter-wrapper {
  display: none;
}

plopesc made their first commit to this issue’s fork.

plopesc’s picture

Status: Active » Needs review

Created 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.

smustgrave’s picture

Status: Needs review » Needs work

Thanks 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"

plopesc’s picture

Thank 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.

sokru’s picture

Issue summary: View changes

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.

+1 for adding it on widget level, so its easier to make allowed_format contrib module obsolete.

mstrelan’s picture

As 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.

dqd’s picture

@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.

samuhe’s picture

MR seems good.

+1 for having a global setting, overrideable on widget level.

longwave’s picture

If 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.

w01f’s picture

+1 to "Display tooltips" per longwave's suggestion - my preference would be off by default.

scotwith1t’s picture

+1 here as well for off by default. i almost always end up hiding these.

kopeboy’s picture

yep, +1 for hiding the long tips, would be nice to have a tooltip when hovering a (?)

mattdanger’s picture

+1 to off by default as @longwave suggested

catch’s picture

catch’s picture

quietone’s picture

Issue summary: View changes
Status: Needs work » Postponed

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

poker10’s picture

Status: Postponed » Needs work
smustgrave’s picture

Assigned: Unassigned » smustgrave

May work on this at the airport

idebr’s picture

The 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?

smustgrave’s picture

Assigned: smustgrave » Unassigned
Status: Needs work » Postponed (maintainer needs more info)

I never got around to looking at this :( but good question.

longwave’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Yep this is obsoleted by #3505370: Remove 'filter tips' page and deprecate the long format API which hides it permanently for everyone.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

idebr’s picture

Title: Add an option to 'hide filter tips' on text fields » Add an option to 'hide filter guidelines' on text fields
Status: Closed (outdated) » Needs work
StatusFileSize
new33.02 KB

There is still the filter guidelines when the Text Format does not use an editor: