Experimental project
This is a sandbox project, which contains experimental code for developer use only.
In an ideal world, a Drupal theme is nothing but a well-crafted collection of thought-out, reusable components that create beautiful pages when put together. In our real world, pressure to achieve uniqueness within a short timeframe often leads design teams to create pages that are a mix of reusable components and custom HTML+CSS that is going to be used in only a single landing page and nowhere else.
Faced with this situation, Drupal developers have the difficult task of choosing between two bad options: either allow the editors to add custom HTML and CSS directly into a node, block or paragraph, making it unversioned and very hard to maintain, or include it somewhere into the site’s theme, hoping it’s going to be reused some day in the future, thus bloating the codebase. To complicate things further, in the second scenario, editors are usually unable to edit text within the HTML hard-coded in the theme, thus adding more tasks to the dev team.
This module provides a cleaner middle ground to help you manage unreusable HTML+CSS code. It creates an interface within Drupal in which administrators can create custom HTML in a way that can be exported to configuration. These custom pieces of HTML and CSS can then be used in nodes, in paragraphs or in blocks (in a Layout Builder, for instance). More knowledgeable editors still retain the ability to edit the text within the HTML, but at the same time developers can still maintain sane deployment practices by exporting the configuration from a development environment and importing the configuration (drush cex/drush cim) into a production environment.
Moreover, the usage of each piece of custom HTML throughout the website can be easily tracked in the admin interface, so an administrator can easily identify code that is no longer being used anywhere in the website and remove it from the codebase, thus avoiding forgotten code and making maintenance easier.
Project information
- Project categories: Administration tools, Content editing experience, Site structure
- Created by josesanmartin on , updated
