Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Usage Milestone: Time Field for Drupal 8+ Module time_field crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Custom Formatters

3,137 sites Security covered Drupal 8–11
View on drupal.org

This module provides a user interface for creating custom field formatters without writing custom code. It allows formatting fields using presets, HTML with tokens, PHP, or Twig, and exports these formatters as configuration entities.

πŸ‡ΊπŸ‡¦

This module is maintained by Ukrainian developers.
Please consider supporting Ukraine in a fight for their freedom and safety of Europe.

The Custom Formatters module allows users to easily create custom Field Formatters through an admin UI without writing a custom module. Custom Formatters are exported as Drupal configuration entities.

Β 

Requirements:

  • Drupal 10 or 11
  • PHP 8.2+

Β 

Features:

  • Pluggable formatter engines:
    • Formatter Preset
      Build formatters from existing field formatters with preset settings.
    • HTML + Tokens
      A HTML based editor with Token support, including a Token tree browser when the Token module is installed.
    • PHP
      A PHP based editor with support for multiple fields and multiple values.
    • Twig
      A Twig based editor with support for multiple fields and multiple values.
  • Per-instance formatter settings via Field UI β€” add configurable fields to a formatter via its "Manage fields" tab; settings appear inline in "Manage display" and are passed to engine templates as both rendered strings and raw unformatted values:
    • PHP: $settings['field_name'] (rendered), $raw_settings['field_name'] (raw).
    • Twig: {{ settings.field_name }} (rendered), {{ raw_settings.field_name }} (raw).
    • HTML+Token: [formatter_setting:field_name] (rendered), [formatter_setting:field_name:raw] (raw).
  • Supports all fieldable entities, including but not limited to:
    • Drupal core β€” Comment, Node, Taxonomy term, User, and Media entities.
  • Exportable as Drupal configuration entities.
  • Live preview using real entities, with Devel Generate integration for generating sample entities when no real entities exist with the target field type.
  • Integrates with:
    • Contextual links (Drupal core)
      Adds a hover link for quick editing of Custom Formatters.
    • Token
      Adds the Token tree browser to the HTML + Tokens engine with automatic entity reference token support.
    • CodeMirror Editor (optional)
      Provides syntax-highlighted code editing for the PHP, HTML+Token, and Twig engines, with context-aware autocomplete.
    • Devel Generate (optional)
      Generates sample entities with dummy field data for the live preview system.

Β 

Recommended Modules:

  • Token β€” Token tree browser for the HTML + Tokens engine.
  • Field tokens β€” Formatted field and field property tokens for the HTML + Token engine.
  • CodeMirror Editor β€” Syntax-highlighted code editing with context-aware autocomplete.
  • Devel β€” Devel Generate sub-module for generating sample preview entities.

Β 

Configuration:

Read the manual at: https://www.drupal.org/node/2514412

Depends on

Dependencies of the latest stable release

  • field Drupal core
  • field_ui Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
5
Tracked since
Apr 2025
Latest release
1 month ago
Releases (12 mo)
4 ▲ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
4.1.0 Stable 8–11 Jul 31, 2026
4.1.0-beta3 Pre-release 8–11 Jun 7, 2026
4.1.0-beta2 Pre-release 8–11 May 24, 2026
4.1.x-dev Dev 8–11 May 3, 2026
4.1.0-beta1 Pre-release 8–11 Apr 30, 2025