I wrote a very simple plugin, tabs, that basically just ships a JS file and enables its use via a partial template and a partial blueprint. This way, the user (as in, developer using the plugin) can decide how/where to use it exactly.
The plugin hence comes with:
- templates/partials/tabs.html.twig
- blueprints/partials/tabs.yaml
In the past, I was able to import that partial blueprint like this, for example:
title: Tabs
extends@: default
form:
fields:
tabs:
type: tabs
active: 1
fields:
tabs:
type: tab
title: “Tabs”
import@:
type: partials/tabs
context: blueprints://
The way I got Grav to pick up the plugin’s blueprints is via this method in the Plugin’s PHP file:
public function onGetPageBlueprints(Event $event)
{
$types = $event->types;
$types->scanBlueprints(‘plugin://’ . $this->name . ‘/blueprints’);
}
This stopped working - not sure when. But it doesn’t work in Grav 1.8.
I tinkered a little and noticed that changing the import@ statement like this gets it to work again, and apparently I can then ditch the function in the tabs.php file entirely, which is nice:
import@:
type: partials/tabs
context: plugins://tabs/blueprints
But it seems less clean of a solution to have the user be required to specify the location of the partial blueprints so explicitly, including the plugin name in this case.
Is this just how it works in 1.8, or is there some other stuff I’m not aware of? What’s the “correct” way to handle providing partial blueprints for import via a plugin in 1.8?
