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.

Plugins

How to use import@ in form section of plugin blueprints.yaml

plugins

Solved by raver View solution

Started by raver 8 months ago · 3 replies · 55 views
8 months ago

for flex i use it a lot like this

YAML

    ps8:
      type: section
      import@8:
        type: quark/blueprints/geneller/menu
        context: themes://

idk about plugin blueprints.yaml

👍 1
8 months ago Solution

Thanks, that worked.
I was missing the following rules:

  • you must(?) use a section for the import
  • you must(?) define the type with the folder name of your plugin as root, then all down to the blueprints file (server.yaml) excluding the suffix!
    • tested: or you set context: plugins://xmpp then you define type relative to your plugin directory. (I prefer that 😃 )
  • it must(?) be a number in import@1, using a string does not work e.g. import@db

this worked for my plugin xmpp to include the file
$grav_root/user/plugins/xmpp/blueprints/partials/plugin/server.yaml

YAML
test_import:
  type: section
  import@1:
    type: xmpp/blueprints/partials/plugin/server
    context: plugins://

and this works too, (this is what I’m using now)

YAML
test_import:
  type: section
  import@1:
    type: blueprints/partials/plugin/server
    context: plugins://xmpp

even recursive includes (an included file contains an include) work.
I’m new to Grav, but it is already the coolest CMS I’ve seen in ages. It even motivated me to do PHP Again 😃

Thanks again for your Help 🙂

last edited 10/17/25 by raver
8 months ago

@raver:

  • you must(?) use a section for the import
  • you must(?) define the type with the folder name of your plugin as root, then all down to the blueprints file (server.yaml) excluding the suffix!
  • tested: or you set context: plugins://xmpp then you define type relative to your plugin directory. (I prefer that 😃 )
  • it must(?) be a number in import@1, using a string does not work e.g. import@db

i saw i could do many things with using flex and i tried to use it for so many things.
while doing that, "learn grav" helped a lot but still wasnt enough and i tried so many things for not hours but days :)

  • from my experience and use cases, "section" is not a must but most compatible.
  • i also guess we must.
  • i also guess we must.
  • yes, but not "1" only. it can be any number, just had to be different from others since we use yaml, any number is okay and wont change anything other than being different.

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 42 1 week ago
Plugins · by Xavier, 4 weeks ago
2 53 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1179 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 47 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 71 2 months ago