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

Template from Plugin not usable in Admin

Solved by Werner Joss View solution

Started by Werner Joss 5 years ago · 2 replies · 413 views
5 years ago

I'm currently stumbling over an IMHO strange behaviour when trying to use a template from my plugin in the admin backend.
I followed the official docs and then created calendar.html.twig in my plugin's template directory.
now when I create a new page, I thought it would be possible to select this template as Page Template, but it does not work.
I can, however, create a file calendar.md in a new page folder, an then, in the admin, it looks like this:
grafik|690x247

  • note that the type calendar is correctly displayed, and I can also see that the template is actually used when I look at the page, but: I can't select the correct template in the dropdown - my custom type is just not displayed there, so, saving the page in the admin is not possible, because it will be of a wrong type.
    did I miss something here ?
5 years ago Solution

ok, the solution seems to be simple, I had to use the Override Option for Display templates:
grafik|523x499
so, as a conclusion, page save in admin does work and preserve the correct page type,
but that ist not selectable in the dropdown, where only the templates from the theme will be shown.

👍 1
5 years ago

just to complete this issue, after some more investigation, I found a much more elegant solution here, which actually allows direct selection of plugin-provided templates in the admin.
this is now also implemented in the latest version of my fullcalendar plugin.

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 75 1 week ago
Plugins · by Xavier, 4 weeks ago
2 81 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1208 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 75 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 99 2 months ago