Drupal is a registered trademark of Dries Buytaert
External Authentication Module externalauth crossed 100,000 active installs. SSO Connector 1.0.3 Minor update available for module sso_connector (1.0.3). Field Widget Actions 1.4.1 Minor update available for module field_widget_actions (1.4.1). Multisite Manager Tool 2.0.0 Major update available for module multisite_manager_tool (2.0.0). Remote File Importer - SFTP Datasource 1.2.0 Minor update available for module remote_file_importer_sftp (1.2.0). LocalGov News 2.5.4 Minor update available for module localgov_news (2.5.4). LocalGov Guides 2.2.5 Minor update available for module localgov_guides (2.2.5). LocalGov Step-by-step 2.2.5 Minor update available for module localgov_step_by_step (2.2.5). LocalGov Subsites 2.6.2 Minor update available for module localgov_subsites (2.6.2). Simple Google Maps 4.0.1 Module simple_gmap updated after 17 months of inactivity (4.0.1).

Form Twig Template Suggester gives themes stable Twig suggestions for individual form controls (text fields, selects, buttons, and more). That means you can override one submit button or one field in a specific form without fighting Drupal’s changing HTML IDs or changing how the form submits.

It is aimed at site builders and themers who need predictable template names like input--submit--form--contact--submit.html.twig.

Features

  • Automatically adds form-scoped theme suggestions for common form elements: input, select, textarea, radios, checkboxes, button, form_element, and form_element_label.
  • Uses cache-safe, namespaced render-array metadata only (#twigsuggest_form_*). It does not change core #name or #form_id on form children, so Form API and AJAX behaviour stay intact.
  • Stable “source” identity per form family:
    • Webform — webform machine name (for example contact), not the long per-entity submission form id
    • Views exposed forms — cleaned Views form id, with consistent naming for action buttons
    • Other forms — PHP form id
  • Extensible: other modules can add tagged resolvers for custom form types.
  • AJAX / FormCache friendly (including multi-step Webforms).
  • Works alongside contrib twigsuggest (HTML-id style suggestions); this module focuses on form-scoped names.

When to use it: you need theme templates keyed by form + control, especially where HTML IDs change across pages or AJAX rebuilds (contact forms, search forms, multi-step forms, and similar).

Post-Installation

  1. Enable Form Twig Template Suggester (twigsuggest_form).
  2. Clear caches.
  3. There is no configuration page, no new content types, and nothing to set under text formats.
  4. Turn on Twig debugging (or inspect suggestions another way) and open a page with a form. Look for suggestions such as input--submit--form--{source}--{name}.html.twig or form-element--form--{source}.html.twig.
  5. Add matching templates in your theme, for example input--submit--form--user_form--op.html.twig or input--textfield--form--contact--email.html.twig.

Behaviour applies automatically to forms. If Webform or Views are installed, source IDs for those forms become more stable and theme-friendly.

Additional Requirements

  • Drupal core ^11.2
  • PHP 8.3+

No required contrib modules, libraries, or external APIs beyond Drupal core.

  • Webform — machine-name based suggestions and better support for multi-step / composite forms
  • Views (in core on modern Drupal) — exposed-form source resolution
  • twigsuggest — complementary ID-based suggestions; safe to use together

Similar projects

  • twigsuggest — focuses on suggestions from HTML IDs / attributes. Form Twig Template Suggester instead stamps form identity in a cache-safe way and builds form-scoped suggestions without writing data-* attributes or altering Form API #name / #form_id.
  • Themable Forms — classic approach of copying #form_id onto children for form_element suggestions. This module uses namespaced properties only, covers more control types, and adds Webform/Views-aware source IDs.

Supporting this Module

Development is supported by Big Blue Door.

Community Documentation

Note: This project is not (yet) covered by Drupal’s security advisory policy. Use accordingly until it opts into the security team process.

Activity

Total releases
4
First release
Jul 2026
Latest release
1 hour ago
Releases (12 mo)
4 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.0.0-beta3 Pre-release Jul 21, 2026
1.0.0-beta2 Pre-release Jul 21, 2026
1.0.0-beta1 Pre-release Jul 21, 2026
1.0.x-dev Dev Jul 21, 2026