Add mechanism to limit allowable view modes

Created on 17 June 2021, almost 4 years ago
Updated 14 January 2025, 3 months ago

Problem/Motivation

Generally speaking, some view modes are usually not a good candidate for inclusion in the list for content editors to choose from. It would be nice to have a way to limit the view modes to a limited subset that are known to work well with embedding.

I would be more than willing to build this feature and relevant tests if the maintainer would be open to merging it in.

Thank you!

Proposed resolution / Remaining tasks

  • Add a settings form to the module that allows a user to limit which may be embedded.
  • Add configuration schema definitions for the new configuration.
  • Do an array intersect within \Drupal\entity_browser_block\Plugin\Block\EntityBrowserBlock::processTable that removes illegal choices from the #options array.
  • Make the view mode field required in the table.
  • Add a new permission for administering entity browser block configuration.
  • Add a route to access the config form.
  • Write some tests!
  • User acceptance testing.

or

Would it make more sense to limit things on a per-entity-browser basis instead?

User interface changes

A new settings form for the module.

API changes

None

Data model changes

None

✨ Feature request
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States luke.leber Pennsylvania

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024