Skip to header Skip to main navigation Skip to main content Skip to footer
Cookies UI
Alaa Haddad Offers Exceptional Drupal Custom Theming and Modules in Austin TX Alaa Haddad - Drupal Expert
Main navigation
  • Professional Profile
  • Drupal Services
    • Drupal Development
    • Drupal Developer
    • Drupal Themer
    • Drupal Architect
    • Drupal Consultant
  • My Drupal Modules & Themes
      • Cloudflare Purge
      • Solo Copy Blocks
      • W3CSS Paragraphs
      • Paragraphs Bundles
      • Acquia Purge Varnish
      • Reference Blocked Users
      • Module Matrix
      • Paragraphs Bundles Import
      • Selectify
      • Solo Utilities
      • Utilikit
      • Solo
      • Amun
      • Anhur
      • Amunet
      • W3CSS Theme
      • 3D Carousel
      • 3D FlipBox
      • Accordion
      • Carousel
      • Hero
      • Lightbox
      • Parallax
      • Reveal
      • Slideshow
      • Tabs
  • Blog
  • Videos
  • Contact
  • Hire Me (opens in new tab)
Search form
User login
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
  • Reset your password
User account menu
  • Hire Me (opens in new tab)
  • Drupal Services
  • Blog
Site branding
Alaa Haddad - Drupal Expert
Consultant • Architect • Developer • Themer - Expert Drupal Solutions
Article Title Image - Block 1

Per-Content-Type Node Edit Form Templates in the Solo Theme

Content Info - Article Info
 
  10:55 PM CDT, Sun September 13, 2026
Share

Breadcrumbs

Breadcrumb

  • Home
  • Drupal Theme
  • Per-Content-Type Node Edit Form Templates in the Solo Theme

Main page content

The Solo theme adds a per-content-type theme hook suggestion to the node add and edit form, so a template named node-edit-form--article.html.twig in your sub-theme applies to Article forms and nothing else. Drupal core does not offer this. Core routes every node form through one template, which is fine until you have a content type with thirty fields and an editor who has to scroll past twenty of them to reach the one they came for.

This is how the mechanism works, how to use it, and the one rule that catches everybody the first time.

Why bother customising an edit form at all

Because the edit form is the product, for the people who use your site every day. A content team that fills in the same complex form fifty times a week is paying a small tax on every single one, and an editorial interface that groups related fields together and hides the irrelevant ones is worth more to them than most front-end polish. It is also the cheapest usability work available on a Drupal build: no new modules, no new dependencies, one template file.

How Solo wires it up

Two pieces of theme code make it work, and it is worth knowing both so you can tell what is failing when something does not.

First, Solo alters every node form and sets its #theme to node_edit_form. Without that step, node forms fall through to the generic form.html.twig and no node-specific template is consulted at all. The same alter also converts the advanced and meta groups into containers and pushes revision information under the meta group, which is what produces the familiar two-column editing layout.

Second, Solo implements the theme suggestion hook for that hook name and appends node_edit_form__<bundle>. It works out the bundle two ways: from the node object on the form when you are editing, and from the node_type route parameter when you are creating. That second path matters — without it your template would apply on edit and silently not apply on add, which is a maddening thing to debug.

The suggestion translates to a filename by the usual Drupal rule: underscores become hyphens, and the double underscore becomes a double hyphen. node_edit_form__article becomes node-edit-form--article.html.twig.

Doing it, in four steps

1. Work in a sub-theme

Never edit the theme's own templates. Solo ships an empty starter sub-theme for this, and a Composer update of the parent will overwrite anything you put in the parent's directory. If you have not set one up, the Solo setup order covers where the sub-theme decision belongs in the sequence.

2. Copy the base template

Take templates/admin/node-edit-form.html.twig from the Solo theme and put it in your sub-theme at templates/admin/node-edit-form--article.html.twig. Copying rather than starting blank matters: the shipped template attaches the stylesheet that produces the two-column layout, and a template that omits that line renders an unstyled stack of fields.

3. Clear the cache and confirm the template is being used

Theme hook suggestions are cached. Run drush cr, then turn on Twig debugging at /admin/config/development/settings and load the Article add form. Drupal writes an HTML comment into the page source listing every candidate template and marking the one it chose, so you can see immediately whether your file was even found.

Do this before you start moving fields around. Half the time spent on this task is spent editing a file that was never being read.

4. Print the fields you want, and exclude them from the rest

Inside the template, render individual fields by name and then output everything you have not named:

{{ attach_library('solo/solo-node-edit-form') }}

<div class="layout-node-form solo-clear">
  <div class="layout-region layout-region-node-main solo-padding">
    {{ form.title }}
    {{ form.field_subtitle }}
    {{ form.body }}
    {{ form|without('title', 'field_subtitle', 'body', 'advanced', 'footer', 'actions') }}
  </div>

  <div class="layout-region layout-region-node-secondary solo-padding">
    {{ form.advanced }}
  </div>

  <div class="layout-region layout-region-node-footer solo-padding">
    {{ form.footer }}
    {{ form.actions }}
  </div>
</div>

Per-content-type form templates are a small change that ages badly when nobody documents them. Drupal theming covers doing it so the next person can read it.

The rule that catches everyone

Every field you print explicitly must also appear in the without() list. Miss one and it renders twice — once where you placed it and once inside the catch-all — and because both copies are functional form elements, the duplicate is not merely cosmetic. It is confusing to editors and it is the first thing to check when a form looks almost right.

To find out what you can print, add {{ dump(form) }} to the template while Twig debugging is on. Take it out again before you commit; leaving a form dump in a template ships your form structure into the page source.

Common questions

Can I do this without a per-content-type template?

Yes, if the change should apply to every content type — override node-edit-form.html.twig in your sub-theme with no bundle suffix. Use the per-bundle form only when the content types genuinely need different layouts.

Does this replace Field Group or Layout Builder?

No, and it is not competing with them. Field Group is configuration and travels with a config export; a Twig template is code and travels with git. Field Group is the better answer for anything a site builder should be able to change. A template is the better answer when the arrangement is structural and you want it reviewed in a pull request.

Will this survive a Drupal upgrade?

Theme hook suggestions are a stable Drupal API and the pattern has been unchanged for years. What can move under you is the internal structure of the node form itself — the names of the advanced, meta, footer and actions groups. Re-run the dump(form) check after a major core upgrade rather than assuming.

What if my field does not appear when I print it by name?

Check the field's machine name in Structure → Content types → Manage fields, and check the field is not hidden on that form display. A field disabled in the form display is not in form at all, so printing it produces nothing and no error.

Does the suggestion work on the node add form as well as edit?

Yes. Solo reads the bundle from the route's node_type parameter when there is no node object yet, which is what makes the add form work. If you are writing this hook yourself in another theme, that is the branch people forget.

When this is worth the hour

Customise the edit form when a content type has enough fields that editors are getting them wrong, or when a specific field needs to be next to another one to be filled in correctly. Do not do it because the default looks plain — the default is fine, and every template you own is a template you maintain.

For form improvements that are configuration rather than code, Selectify covers the select-widget side of the same problem. And if you are untangling why an editorial interface has become unusable, that is usually a content-model question before it is a template one — the kind of thing that turns up in the portfolio more often than a redesign does.

If you want the editing experience for a complex content type designed and built rather than iterated at, that is Drupal development work and it is normally measured in hours, not weeks.

Drupal Theme
Slide 1 of 27
Acquia Purge Varnish - API V2 (Drupal Module)
Slide 2 of 27
Amun - W3CSS Sub-Theme (Drupal Theme)
Slide 3 of 27
Amunet - W3CSS Sub-Theme (Drupal Theme)
Slide 4 of 27
Anhur - W3CSS Sub-Theme (Drupal Theme)
Slide 5 of 27
Cloudflare Purge (Drupal Module)
Slide 6 of 27
Module Matrix (Drupal Module)
Slide 7 of 27
Paragraphs Bundles (Drupal Module)
Slide 8 of 27
Paragraphs Bundles Import (Drupal Module)
Slide 9 of 27
Reference Blocked Users (Drupal Module)
Slide 10 of 27
Selectify (Drupal Module)
Slide 11 of 27
Solo (Drupal Theme)
Slide 12 of 27
Solo Copy Blocks (Drupal Module)
Slide 13 of 27
Solo Utilities (Drupal Module)
Slide 14 of 27
Utilikit (Drupal Module)
Slide 15 of 27
Views 3D Carousel (Drupal Module)
Slide 16 of 27
Views 3D FlipBox (Drupal Module)
Slide 17 of 27
Views Accordion (Drupal Module)
Slide 18 of 27
Views Carousel (Drupal Module)
Slide 19 of 27
Views Hero (Drupal Module)
Slide 20 of 27
Views Lightbox (Drupal Module)
Slide 21 of 27
Views Parallax (Drupal Module)
Slide 22 of 27
Views Reveal (Drupal Module)
Slide 23 of 27
Views Slideshow (Drupal Module)
Slide 24 of 27
Views Tabs (Drupal Module)
Slide 25 of 27
VVJ Core (Drupal Module)
Slide 26 of 27
W3CSS Paragraphs (Drupal Module)
Slide 27 of 27
W3CSS Theme (Drupal Theme)
1 of 27

Our mission is to make Drupal more accessible and user-friendly, empowering businesses of all sizes, especially small enterprises with powerful tools that streamline content customization and enhance digital experiences.

Need help with your Drupal project? Hire Me through Flash Web Center, LLC.

Search

The Drupal 11 Module and Theme Stack, With Versions Checked

ARIA Live Regions in Drupal 11: What Core Does, What You Add

Drupal Architect: The Decisions Expensive to Reverse

Drupal Services: Development, Theming, Upgrades | Austin TX

Paragraphs Bundles

Drupal Module - Paragraphs Bundles

Drupal Theme - Solo

Drupal Theme - Solo

Drupal Work List - Drupal Work

Reference Blocked Users (Drupal Module)

Solo Utilities (Drupal Module)

Views Hero (Drupal Module)

Solo (Drupal Theme)

Paragraphs Bundles Import (Drupal Module)

Drupal Theme - W3CSS Theme

Drupal Theme - W3CSS Theme

Drupal Module - W3CSS Paragraphs

Drupal Module - W3CSS Paragraphs

Inspiration

Inspiration is the fuel that powers our creative engine, often coming from our surroundings, experiences, or the works of others. It's that magical moment when something clicks inside your brain, and you suddenly see a path forward that you hadn't noticed before. Inspiration can strike at any time, providing the motivation and energy needed to explore new possibilities and bring your ideas to life.

Unique Ideas

Unique Ideas

Unique ideas are the seeds of innovation, representing original thoughts or concepts that stand out from the usual. They're the sparks that ignite the process of creating something new and different, often leading to unexpected and groundbreaking solutions or products. Whether in art, science, business, or technology, unique ideas challenge the status quo and pave the way for progress.

Brainstorming

Brainstorming

Brainstorming is a creative group activity designed to generate a large number of ideas or solutions to a problem. It's a free-flowing and open-ended discussion where every suggestion is welcomed and considered, no matter how outlandish it may seem. Brainstorming encourages thinking outside the box, fostering an environment where creativity and collaboration lead to innovative solutions.

Planning

Planning

Planning is the blueprint for turning your ideas into reality. It involves setting goals, outlining steps, and organizing resources in a way that makes achieving your objectives possible. Good planning considers potential challenges and opportunities, making it easier to navigate the journey from concept to completion. It's about preparing the groundwork so that your projects can grow and flourish.

Drupal Developer

A Drupal Developer stands as the technical powerhouse behind dynamic websites, wielding expertise in PHP, custom module development, and Drupal's sophisticated API ecosystem. This role transforms business requirements into functional, secure, and scalable web solutions that power everything from small business sites to enterprise platforms serving millions of users. A Drupal Developer's expertise spans the entire development lifecycle—from architecting custom modules and integrating third-party services to optimizing performance and ensuring security compliance. Discover the complete guide to Drupal Developer skills, career paths, and hiring strategies.

Drupal Themer

A Drupal Themer serves as the artistic craftsperson who transforms wireframes and design mockups into pixel-perfect, accessible, and responsive user experiences using Twig templates, CSS, and JavaScript. This specialized role bridges the gap between design vision and technical implementation, ensuring every website not only looks exceptional but performs flawlessly across all devices and meets WCAG accessibility standards. A Drupal Themer's work encompasses the entire front-end ecosystem—from creating custom theme architectures and optimizing Core Web Vitals to implementing complex responsive designs and ensuring seamless integration with Drupal's rendering system. Explore the comprehensive guide to Drupal Themer expertise, theming best practices, and career advancement.

Drupal Architect

A Drupal Architect emerges as the strategic visionary of web construction, armed with encyclopedic knowledge of enterprise architecture patterns, infrastructure design, and Drupal's extensive technological ecosystem. This senior role operates at the highest technical level, making critical decisions that determine whether complex implementations scale successfully or collapse under real-world demands. A Drupal Architect's responsibilities begin long before development starts—during strategic planning phases where the foundation for secure, performant, and maintainable systems is established through careful evaluation of technology stacks, integration strategies, and scalability requirements. Learn about Drupal Architect skills, enterprise architecture strategies, and career progression to principal roles.

Footer menu

  • Contact
  • Professional Resume
  • Resume Summary
  • Technical Skills
  • Privacy Policy
  • Terms & Conditions
  • Search
  • Login
  • Sitemap

Copyright © 2026 Flash Web Center, LLC - All rights reserved

Developed & Designed by Alaa Haddad