Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme inheritence not working? #1353

Closed
rbukovansky opened this issue Mar 15, 2017 · 6 comments
Closed

Theme inheritence not working? #1353

rbukovansky opened this issue Mar 15, 2017 · 6 comments
Assignees

Comments

@rbukovansky
Copy link

I'm trying to follow https://learn.getgrav.org/themes/customization#theme-inheritance as I'm trying to enhance theme knowledge-base with updates our company needs, but I'm getting this error:

Whoops \ Exception \ ErrorException (E_ERROR)
Class 'Grav\Theme\KnowledgeBase' not found

My theme files:

blueprints.yaml:

name: NETTO Knowledge Base
version: 0.0.1
description: "Extending Knowledge Base theme"
icon: crosshairs
author:
 name: Richard Bukovansky
 email: [email protected]
 url: https://github.com/rbukovansky

netto-knowledge-base.php:

<?php
namespace Grav\Theme;

use Grav\Common\Theme;

class NettoKnowledgeBase extends KnowledgeBase
{
   // Some new methods, properties etc.
}
?>

netto-knowledge-base.yaml:

streams:
 schemes:
   theme:
     type: ReadOnlyStream
     prefixes:
       '':
         - user/themes/netto-knowledge-base
         - user/themes/knowledge-base

Anybody has an idea, what could be wrong? Thank you.

@rbukovansky
Copy link
Author

rbukovansky commented Mar 15, 2017

Ad netto-knowledge-base.php: I'm getting same error no matter if there is or is not this line:

use Grav\Common\Theme;

@Perlkonig
Copy link
Contributor

I'm sure it has something to do with the hyphenated file name. I see this mentioned in the forum, but no solution is given. I didn't think I could simply rename my php file knowledgebase.php and it still work.

@rbukovansky
Copy link
Author

Well, I have removed dashes from files and folders names and any mentions in .yaml files for these themes and guess what? It really works... Huh...

@Perlkonig
Copy link
Contributor

Does it really work, though? This theme doesn't have anything in the PHP file, but if it did, would it still properly inherit? No thrown errors is one thing, but that doesn't mean it's working as it should.

@rhukster
Copy link
Member

Ok, sorry this took so long, should be sorted with last commit.

@rbukovansky
Copy link
Author

@Perlkonig Yup, it worked...

@rhukster That's OK, and I can confirm, that change makes my Grav installation with inherited theme work again. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants