grav-plugin-admin icon indicating copy to clipboard operation
grav-plugin-admin copied to clipboard

“Add modal” blueprints not picked from theme’s blueprints folder

Open k8n opened this issue 7 years ago • 3 comments

Would anyone know how to make admin “see” blueprints specified via add_modal configuration option within theme’s blueprints folder?

If I place ‘admin/pages/new_post.yaml’ under ‘user/blueprints’ it works. If I place it under ‘theme/active_theme/blueprints’ it does not work.

I’ve gone as far as doing scanBlueprints() within an appropriate event handler in the theme - nothing.

https://github.com/getgrav/grav-plugin-admin/blob/ac41a3a57a9274c96d64ef0ce9643406deff685e/themes/grav/templates/pages.html.twig#L360

k8n avatar Aug 29 '18 18:08 k8n

Themes ONLY support page blueprints at the root.

rhukster avatar Aug 29 '18 21:08 rhukster

I’d like to make a case for it. Themes already support admin blueprints, e.g. as used in antimatter. It would be convenient and logical to let themes keep that stuff together with add_modals.

The widget plugin amends add_modals configuration; this technique works in themes. Same plugin supplies it’s own add_modal blueprints; yet themes cannot.

Is the order of plugin and theme initialization events the issue? I’m not sure where to look to fix this, but eager to do a PR.

k8n avatar Aug 30 '18 02:08 k8n

Late to the party. Very keen to see this option myself. I support the arguments presented.

hughbris avatar Apr 05 '22 04:04 hughbris