Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Forms & Blueprints

Extending blueprints multiple times through plugins and theme

admin blueprints plugins theme

Started by Alex 4 years ago · 1 replies · 573 views
4 years ago

Hi everyone,

context: I'm have written some plugins which extend form and email capabilites of grav. therefore I need to extend an blueprint for the admin view several times (one plugin is for email encryption, one is for handling attachments and last but not least there are some theme specific fields).

problem: the blueprint form.yaml doesn't exist by default in admin or in any other core extension/plugin and so (if I'm not mistaken) grav/admin plugin picks default.yaml to render backend view of form page type.
I know I can extend blueprints by extends@: parent@ what will extend the blueprint of the same name. But as there is no form.yaml by default, one of my form.yaml files needs to extend default.yaml via

TXT
extends@: 
  - type: default
  context: blueprints://pages

otherwise I was unable to get it to work
so there needs to be an order, which actually defeats the meaning of having independent plugins.
Do I miss something here? Is there a workaround for this? Or do I need to "force" any future plugin users to copy a "default" form.yaml into their system / blueprints / pages folder?

I would be very grateful for any suggestions or hints.
Thanks everyone and have a nice day

just_a_typo

4 years ago

I was able to get this to work:

TXT
'@extends':
  type: modular
  context: blueprints://pages

My page blueprint is in a "modular" subfolder of blueprints/pages

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1138 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 62 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 136 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 110 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 130 7 months ago