I’m working on a custom theme and creating new modular sections. Grav does detect the modular types (they appear in the template selection dropdown), and the .html.twig and .yaml files are all in the correct folders:
However, the issue is that the custom fields defined in the modular blueprint do not appear in the normal Admin view when editing the modular page. Only the default fields show up, even though the YAML blueprint extends the correct page type and has valid syntax.
Important details:
The page blueprint and the theme blueprint do show correctly in Admin
Only the modular blueprint’s fields fail to appear
The modular type itself is listed and selectable
Cache has been cleared multiple times
YAML indentation and naming match the template exactly
So Grav recognizes the modular template but ignores the blueprint fields.
What could cause Admin to skip rendering the modular blueprint fields even though the file structure is correct and the blueprint is loaded?
Links to the relevant files (with the same structure)
Grav skips blueprints inside the theme/blueprints/modular folder as long as the theme/blueprints/pages folder exists, even if this folder is empty.
When creating blueprints in a theme, IF the pages directory is exists (even if empty), the modular blueprints must be nested in the pages directory. Else they can be in the blueprints/modular directory .
Added an extra field in /user/themes/quark/blueprints/modules/text.yaml
title: Text
'@extends': default
form:
fields:
tabs:
fields:
content:
fields:
header.media_order:
label: Page Media (first one will be displayed next to your content)
header.image_align:
type: select
label: Image position
classes: fancy
default: left
options:
'left': 'Left'
'right': 'Right'
header.myfield:
type: text
label: My Field
description: 'This is My Field'
Field ‘myfield’ is perfectly shown in Admin at the bottom of tab “Content” and its data is saved into the page file.