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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Inherit the grav admin theme

Started by maxime 7 years ago · 0 replies · 488 views
7 years ago

Hello

I am trying to inherit the default grav theme of the admin plugin.

I followed the steps of the documentation for theme inheritance but it doesn't seem to work and I could not find help online to figure out the reason.

Here is what I did:
1) I created a new folder 'user/plugins/admin/themes/mytheme' containing a 'templates' subfolder with my modified templates.

2) at the root of the 'mytheme' folder, I created mytheme.yaml with the following content:

YAML
streams:
 schemes:
   theme:
     type: ReadOnlyStream
     prefixes:
       '':
         - user/plugins/admin/themes/mytheme
         - user/plugins/admin/themes/grav

3) I created a file in user/config/plugins/ called 'admin.yaml', and added 'theme: mytheme' inside.

That's all.

Now, when I load a page of the admin panel, it uses mytheme, but fails to load a partial template that only exists in the parent 'grav' theme. It seems that the configuration I set in mytheme.yaml is ignored and there is no fallback to the grav default theme when a template file is not found in my custom theme.

This is the error I get:

RuntimeException (400)

Template "partials/base.html.twig" is not defined in "pages.html.twig" at line 1.

Previous exceptions

  • Template "partials/base.html.twig" is not defined in "pages.html.twig" at line 1. (0)

I am now wondering if theme inheritance is working for the Admin plugin. If it does, what else should be done?

Thank you in advance for any help on this.

Maxime

👍 1
last edited 02/11/19 by maxime

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 99 16 hours ago
General · by pamtbaau, 21 hours ago
1 63 21 hours ago
General · by Andy Miller, 1 day ago
0 48 1 day ago
General · by Marcel, 12 months ago
6 357 5 days ago
General · by Duc , 6 days ago
3 45 6 days ago