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

blog.html.twig is not defined. theme inheritance problem. #455

Closed
fluidworks opened this issue Nov 19, 2015 · 9 comments
Closed

blog.html.twig is not defined. theme inheritance problem. #455

fluidworks opened this issue Nov 19, 2015 · 9 comments
Labels

Comments

@fluidworks
Copy link

Hello, referring to this: getgrav/grav-plugin-admin#280

I have now this problem:

RuntimeException thrown with message "Template "blog.html.twig" is not defined."

Stacktrace:
#9 RuntimeException in /home/listalav/public_html/sito/system/src/Grav/Common/Twig/Twig.php:335
#8 Twig_Error_Loader in /home/listalav/public_html/sito/vendor/twig/twig/lib/Twig/Loader/Chain.php:115
#7 Twig_Loader_Chain:getCacheKey in /home/listalav/public_html/sito/vendor/twig/twig/lib/Twig/Environment.php:312
#6 Twig_Environment:getTemplateClass in /home/listalav/public_html/sito/vendor/twig/twig/lib/Twig/Environment.php:378
#5 Twig_Environment:loadTemplate in /home/listalav/public_html/sito/vendor/twig/twig/lib/Twig/Environment.php:347
#4 Twig_Environment:render in /home/listalav/public_html/sito/system/src/Grav/Common/Twig/Twig.php:324
#3 Grav\Common\Twig\Twig:processSite in /home/listalav/public_html/sito/system/src/Grav/Common/Grav.php:157
#2 Grav\Common\Grav:Grav\Common{closure} in /home/listalav/public_html/sito/vendor/pimple/pimple/src/Pimple/Container.php:113
#1 Pimple\Container:offsetGet in /home/listalav/public_html/sito/system/src/Grav/Common/Grav.php:255
#0 Grav\Common\Grav:process in /home/listalav/public_html/sito/index.php:37

@rhukster
Copy link
Member

What template is your page supposed to use? Does this template exist in your theme? Does it exist in your parent theme?

@fluidworks
Copy link
Author

It's a blank theme extending Antimatter.

  • user/themes/warg
  • user/themes/antimatter

@flaviocopes
Copy link
Contributor

Can you zip and attach your theme, to recreate the problem?

@fluidworks
Copy link
Author

Hi flavio, there are actually 3 files in a directory called warg, the default blueprints.yaml and a warg.yaml composed as follow:

streams:
schemes:
theme:
type: ReadOnlyStream
prefixes:
'':
- user/themes/warg
- user/themes/antimatter

I have also created a warg.php class:

@rhukster
Copy link
Member

If you can send us a zip, it will enable us to quickly test. Your code is not even indented properly in your reply above because you didn't use code blocks. If you want us to help, please make it as easy for us as possible :)

@flaviocopes
Copy link
Contributor

I assume the indenting in warg.yaml is:

streams:
    schemes:
        theme:
            type: ReadOnlyStream
            prefixes:
                '':
                    - user/themes/warg
                    - user/themes/antimatter

it works fine for me. I can also add a templates/default blog.html.twig file and customize it.

It works fine with antimatter as the default theme?
As Andy says, directly upload a zip to try

@fluidworks
Copy link
Author

Problem found.

http://learn.getgrav.org/themes/customization#theme-inheritance

If i click on copy clipboard it will lose an indent for the second row:

streams:
schemes:
    theme:
        type: ReadOnlyStream
        prefixes:
            '':
                - user/themes/warg
                - user/themes/antimatter

Thank you ! Grav is really awesome !

@flaviocopes
Copy link
Contributor

Might depend on the editor used, I'm getting the indent fine with Sublime or even TextEdit. Good to know it's fixed ;)

@baardev
Copy link

baardev commented Aug 5, 2018

Can you please elaborate on the solution? You link only points to a general documentation page that shows no obvious fix. I am having the same problem,

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

No branches or pull requests

4 participants