Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Override blueprints.yaml from plugin

Started by Pedro M 4 years ago · 3 replies · 941 views
4 years ago

Hello,

I'd like to modify some options in the simple-cookie plugin blueprints.yaml and save it to my theme folder to prevent it from being overridden by future updates.

How can I do it and where should I save the plugin's blueprints.yaml file?

Thank you

4 years ago

Hi there.

I am trying to override the blueprints.yaml for the simple-cookie plugin and I've created a folder into config/plugins, called simple-cookie with a blueprints.yaml modified inside.

After that I have the following error:

TXT
An exception has been thrown during the rendering of a template ("Invalid argument supplied for foreach()").

error_Grav_blueprints|690x295

Somebody know why Grav shows this error?. And Why is the way to override correctly the blueprints.yaml from any plugin?

Thanks.

last edited 10/03/22 by Pedro M
4 years ago

Hello @medi

I'm a novice programmer and although I've used inheritance in themes, I don't see it as easy with plugins. For example, to create a child theme, just create the theme.php file with the following lines:

PHP
<?php
namespace Grav\Theme;

class CustomQuark extends Quark
{
}

However, with plugins I have used the same strategy with:

TXT
class CustomSimpleCookiePlugin extends SimpleCookiePlugin
{

and Grav doesn't work.

I think you have to use some Event Hook as mentioned in the Grav documentation (https://learn.getgrav.org/17/plugins/event-hooks), in theme.php

Keep investigating.

👍 1

Suggested topics

Topic Participants Replies Views Activity
General · by themetman, 24 hours ago
2 40 17 hours ago
General · by Hanns Mattes, 1 week ago
0 121 1 week ago
General · by Karmalakas, 1 week ago
2 185 1 week ago
General · by Hanns Mattes, 3 weeks ago
0 235 3 weeks ago
General · by Dima, 4 weeks ago
1 211 4 weeks ago