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

Access plugin options inside same plugin admin form field

Solved by Karmalakas View solution

Started by Brice Boucard 4 years ago · 2 replies · 471 views
4 years ago

Hi,

I'm trying to declare a new form field within a plugin, inside the admin/themes/grav/forms/fields/field_name/field_name.html.twig.

The new field is then declared through this piece of code:

PHP
        public function onAdminTwigTemplatePaths($event): void
    {
        $paths = $event['paths'];
        $paths[] = __DIR__ . '/admin/themes/grav/templates';
        $event['paths'] = $paths;
    }

In my field, I'd like to access the plugin configuration and use something like that : {{ plugin.plugin_name.option }} but It seems I can't make it work... I read https://learn.getgrav.org/17/cookbook/plugin-recipes#how-do-i-make-data-from-a but I'm not even sure it applies to my case... and if it is, I thinks I'm lost...

Thanks in advance for any suggestion :)

4 years ago

Thanks a lot @Karmalakas 🙂

Sometimes, I search much more complicated stuff than the actual simple way...

Suggested topics

Topic Participants Replies Views Activity
General · by jean-louis67, 3 weeks ago
2 308 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 310 3 weeks ago
General · by Veehem, 4 weeks ago
0 263 4 weeks ago
General · by milkboy, 4 weeks ago
0 264 4 weeks ago
General · by ian russell, 1 month ago
2 335 1 month ago