This project is not covered by Drupal’s security advisory policy.
Normally the field formatter, for an entity view display, is pre-configured by the site builder. While editing content, the user, can't make a decision on how a specific field is formatted. The module allows the user to pick up a formatter preset while editing content, so that they can decide, how to format a given field. A formatter preset consist from formatter plugin ID and its settings.
Presets are created by the site builder. The user doesn't have to understand the internals and details of configuring a formatter. This is an advantage over Formatted Field module, where the editor, in the entity edit form, picks up directly the formatter and has to configure the plugin settings, which requires advanced knowledge. With this module every formatter is pre-configured and stored in a preset with a nice, friendly, and a meaningful label that the user picks up while editing content.
This module is the successor of Formatter Field Preset, which used to work with Drupal 7. But unlike its predecessor, it has no dependency on Formatted Field.
The User Selected Formatter UI (user_selected_formatter_ui) submodule, allows a site builder to manage the presets from the UI.
Usage
As a site builder
- Enable User Selected Formatter UI (
user_selected_formatter_ui) submodule - Add a new field of type "User Selected Formatter Preset" in the entity bundle where the field to be formatted lives. In the new field settings point to the field that you want to format and save.
- Make sure this field is exposed in the form display.
- Visit the edit form of the field that you want to format. You'll notice a new "Format presets" tab, right next to "Edit" tab.
- Click "Format presets" and, using the "Add preset" button, start adding formatting presets.
- Fill in the label of the preset. Note that this label is shown to the user, so it's important to be meaningful.
- Choose field label display mode.
- Select the formatter to be used for this preset and, after filling the plugin configuration, save the preset.
- Add as many presets you like to let the user choose from.
- Use the "User selected formatter" for the field you want to format.
As an editor
When an editor edits the content, they can choose the pre-configured formatter in order to expose the formatted field.
Production
In production, the User Selected Formatter UI (user_selected_formatter_ui) submodule can be disabled.
Architecture
Presets are stored in the third-party settings of the field that needs to be formatted.
Project information
- Project categories: Content display, Content editing experience
- Created by claudiu.cristea on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
Development version: 1.x-dev updated 5 Jan 2025 at 09:56 UTC
