Skip to header Skip to main navigation Skip to main content Skip to footer
Drupal Maintenance and Developments in Austin TX
Drupal Care

Main navigation

  • Home
  • Why Drupal Care?
  • What’s Included
  • About
  • Our Approach
  • Prices & Plans
  • Portfolio (opens in new tab)
  • Blog
  • Videos
  • Contact
  • Site Evaluation

Customizing Node Edit Forms per Content Type in the Solo Theme

Custom node edit form layout for different content types in Drupal Solo theme
Alaa Haddad, professional Drupal developer based in Austin, TX   Drupal Care
  8:30 PM CDT, Sat July 26, 2025
Share

How to Override and Create a Custom Node Edit Form for Each Content Type in the Solo Theme

In the Solo theme, the default node add/edit form is rendered using the following template:

solo/templates/admin/node-edit-form.html.twig

This template is applied to all content types when creating or editing nodes. If you'd like to customize the layout globally for all node types, you can:

  1. Copy the template to your sub-theme: themes/custom/your_subtheme/templates/admin/node-edit-form.html.twig
  2. Modify the HTML structure or layout classes as needed.

Creating a Per-Content-Type Node Edit Template

If you need a custom layout or field arrangement for a specific content type such as Article, follow the steps below.

Step 1: Download the Latest Dev Version of Solo

Make sure you are using the latest development version of the Solo theme, which includes support for node_edit_form theme hook suggestions.

Step 2: Copy the Default Template

Copy the base node edit template:

solo/templates/admin/node-edit-form.html.twig

Rename and place it in your sub-theme using the following format:

node-edit-form--article.html.twig

This template will be used only when editing or creating Article nodes.

Step 3: Print Fields Individually

Inside your custom template, you can render individual fields manually. Here's a basic example:

{{ form.title }}
{{ form.body }}
{{ form|without('title', 'body', 'advanced', 'footer', 'actions') }}

Important: Any field you render explicitly (like form.title or form.body) must be excluded from the form|without() list to prevent duplicate rendering.

Step 4: Discover Available Fields

To see all available fields in the node form, add the following to your Twig template during development:

<pre>{{ dump(form) }}</pre>

This will display the full structure of the form in the HTML source, allowing you to identify field names for manual rendering.

Example Template Structure

{# node-edit-form--article.html.twig #}

{{ 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.body }}
    {{ form|without('title', '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>

Summary

  • To globally customize the node edit form, override node-edit-form.html.twig.
  • To customize per content type, use node-edit-form--[bundle].html.twig.
  • Render specific fields directly and exclude them from the form|without() fallback.
  • Use dump(form) to discover field names and structure during development.

This workflow gives you full control over the structure, grouping, and layout of the node edit form for each content type in your Solo-based sub-theme.

Note:
This article was created in response to Drupal.org issue #3536537, which discussed the need for per-content-type customization of the node edit form in the Solo theme. The solution documented here is now available in the latest development release of the theme.

Drupal Theme

Footer menu

  • About
  • Privacy Policy
  • Terms & Conditions
  • Flash Web Center, LLC (opens in new tab)
  • Web Designer In Austin (opens in new tab)
  • Log in
  • Contact
  • Sitemap

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

Developed & Designed by Alaa Haddad