Thank you for your response! I feel stupid having missed that section of the docs :no_mouth:.
But still I am not able to get it to work correctly. I am going to describe my project in a bit more detail, maybe I am missing something obvious.
I have a Plugin called "gallery" with some extra directories in it:
gallery
│
└─── admin
│ └─── pages
│ │ └ gallery.md
│ │
│ └─── templates
│ └ gallery.html.twig
│
└─── blueprints
└ gallery.yaml
Now in gallery.php:
Using
[code]
$this->enable([
'onAdminMenu' => ['onAdminMenu', 0],
]);
public function onAdminMenu() {
$this->grav['twig']->plugins_hooked_nav['Galerie'] = ['route' => $this->route, 'icon' => 'fa-image'];
}
[/code]
I add a link to the admin menu, which redirects me to /admin/gallery. This is the page where I want my form to live.
I use:
[code]
public function onTwigTemplatePaths() {
$this->grav['twig']->twig_paths[] = 'plugin://' . $this->route . '/admin/templates';
}
[/code]
to add my template and correctly display the page I want.
From here on I have tried
- adding your code
- adding a "fontend form" to gallery.md with
[code]
{% include "forms/form.html.twig" %}
[/code]
in my template
- playing around with the blueprint and use many different ones to check if I have an error somewhere in there
But still I can't get it to work.
It probably is just a stupid beginners mistake but I still hope someone can help me out with this one!
P.S. The final version of the plugin would display a list of all albums (children of the main gallery page), a button to edit them and a button to open a modal with a form which is used to create a new album