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 · 9 replies · 666 views
11 years ago

Right now, I am working on building my own custom theme for my company's new website. Everything was working fine, and I accidentally modified/deleted files and now am getting this error: Screen Shot 2015-05-20 at 4 I have these files in the right place and calling the right ways, but still gives me this error message. Anyone have any idea what it could be?

11 years ago

Are you sure default.html.twig is supposed to be prefixed by ._ in the filename? I could imagine all sorts of errors caused by that.

11 years ago

That's what I thought too! I don't understand why you need the as the prefix before it, I didn't use that before and it worked perfectly fine?

11 years ago

In earnest it should not be there unless some IDE or the like uses it for backup purposes. It will generally cause filesystem problems and, as you've noticed, quite possibly problems with Twig too. Did you try renaming it and dropping those two characters?

11 years ago

Yeah, I dropped that prefix and still gave me the same error. But if I put the prefix back on, it works fine.

11 years ago

Do you have a file called ._default.md in your pages folder somewhere? In case you're following convention and you twig file is probably called default.html.twig and then your page should be default.md

11 years ago

Yah look like you have a hidden file, most likely created by an editor as a backup or 'working copy' file. Weird, because I thought we fixed this by having Grav ignore 'dot' files. What version of Grav are you running? If it's not latest, can you upgrade?

11 years ago

I redid the custom theme template folder again. It seemed to do the trick and works like it should be, still am not sure what was the issue but I appreciate all the input and help!

11 years ago

Glad you got it sorted, but it was a legitimate edge-case that could arise with certain editors and IDEs, so good to get it sorted. FYI, the resulting code is actually marginally faster than before :)

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1330 9 years ago
Archive · by Muut Archive, 9 years ago
2 922 9 years ago
Archive · by Muut Archive, 9 years ago
2 4051 9 years ago
Archive · by Muut Archive, 9 years ago
1 2930 9 years ago
Archive · by Muut Archive, 9 years ago
3 1108 9 years ago