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

Template "default.html.twig" is not defined ()

Started by Muut Archive 11 years ago · 8 replies · 3470 views
11 years ago

Today I tried my first page with the Learn Gravs Theme-Tutorial "Bootstrap", but I got this error-messsage when I tried to load it.

👍 1
11 years ago

Do you have a theme installed? The theme must provide the appropriate template to render the page. If your page is called default.md, it will look for a template called templates/default.html.twig in your theme. Antimatter, Bootstrap, and Afterburner2 have this template by default. Other themes may not have it.

Please read this blog post as it gives more details on how themes in Grav work.

11 years ago

Did you find the cause of this? I just went through the turotial and had the same issue crop up.

11 years ago

Did you do this all the steps in the tutorial: Theme Tutorial?

You need to create the templates/default.html.twig file that extends the templates/partials/base.html.twig

11 years ago

I must have missed something - I did get it to work, but am unsire of what it was I missed.

On a related note - is there a tutorial for setting up simple blog and post templates? I'm decent on front-end stuff, but get a little lost with all the twig stuff. Just hoping you had something to get us newbies started with.

11 years ago

Hi, I have also gone through this tutorial. I made the mistake of creating default.html.tiwg within the templates\partials folder. It needs to be in the templates root folder, not the partials sub folder.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1332 9 years ago
Archive · by Muut Archive, 9 years ago
2 923 9 years ago
Archive · by Muut Archive, 9 years ago
2 4053 9 years ago
Archive · by Muut Archive, 9 years ago
1 2931 9 years ago
Archive · by Muut Archive, 9 years ago
3 1109 9 years ago