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.

Support

Try to inherit a Theme but dont get the new Theme to work properly

Solved by Karmalakas View solution

Started by Kai 1 year ago · 9 replies · 123 views
1 year ago

I am following this Guide: https://learn.getgrav.org/16/themes/customization#inheriting-manually

I am currently using Quark Open Publishing as Theme and would like to use it as Base-Theme.

So my new Theme-YAML looks like this:

YAML
streams:
 schemes:
   theme:
     type: ReadOnlyStream
     prefixes:
       '':
         - user/themes/KageCustomTheme
         - user/themes/quark-open-publishing

And if I switch the Theme to my custom Theme I get this error on the Website:

image|690x338

The Logs say exactly the same:

Template "partials/hero.html.twig" is not defined in "blog.html.twig" at line 34.

But I can't really do something with this Error. And Grav should actually just use the old Theme right?

1 year ago

I found only devtools plugin properly creates a child theme. I never managed to make child theme work when creating step by step manually. Also never bothered to see what's the difference between manual and CLI created themes 🤷‍♂️

1 year ago

Good Point, but I tried it on my Server (IONOS) and doesn't seem to work.

Will now use a Backup locally (Windows) to create it... Hopefully this works.

1 year ago

Nope, didn't work at all. Still the same error as in the Screenshot attached in the Start-Post.

1 year ago

Can any Theme be inherited?

1 year ago Solution

I'll copy here what I was told 🙂

partials/hero.html.twig is not part of quark-open-publishing, but part of quark. Apparently, a child only looks for a template in the parent and not the grandparent.

Will be fixed, when the grandparent (quark) is added to the child’s yaml file:

YAML
streams:
 schemes:
   theme:
     type: ReadOnlyStream
     prefixes:
       '':
         - 'user://themes/child'
         - 'user://themes/quark-open-publishing'
         - 'user://themes/quark'
👍 1
1 year ago

This!

pffttt

Now I need to switch everything over to my newly created theme. Thanks!

1 year ago

Buuuttt, do I need to make sure that the Partials in my Theme get Updated when the Parent-Theme gets updated.

Or is there some Mechanism already in Place in Grav?

1 year ago

@Snickbrack:
Or is there some Mechanism already in Place in Grav?

Not sure, but I don't think so. When theme updates, I believe you'd need to check if any of your overwritten files were affected

👍 1
1 year ago

Okay thanks. Fine for me. I have the Feeling that for my Theme there wont be any Updates soon.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 51 7 hours ago
Support · by Anna, 2 days ago
2 58 10 hours ago
Support · by Justin Young, 11 hours ago
1 30 11 hours ago
Support · by Duc , 1 week ago
2 63 5 days ago
Support · by Colin Hume, 1 week ago
2 55 5 days ago