Blueprint Builder Module for Drupal 10
February 1, 2024
This is a prototype for a module that generates content types, paragraph types, taxonomies and other types of entities by parsing an intuitively simple document that describes the content structure i.e. content models.
A simple form and route (blueprint_builder.prototype_form) is included that accepts a content model as plain text and generates the corresponding entity types.
Plain text is parsed through regular expressions to determine each line as a component (e.g. entity type, field type, field group) or a property for a component (e.g. description, required, multivalue, multivalue_limit, characters, etc).
The syntax includes these patterns:
- Components (entity types, field types, field groups) are specified with ( parentheses ).
- Descriptions are specified with " quotes ".
- Required fields are specified by the "required" keyword.
- Character limits are specified with the pattern "# characters".
- Multivalue fields are specified with the "multivalue" keyword.
- Multivalue limits are specified with the pattern "multivalue #"
Blueprint Plain Text Content Model Example
Standard Page (content type)
"The base standard page."
Title and Description (group)
Page title (plain text)
"Page title appears below the breadcrumbs"
required
100 characters
Meta description (rich text)
"A clear description of the page content, written in short and simple sentences."
required
Publish date (date)
required
Body Content (group)
Body (rich text)
"Provide the content copy for the page"