Hi I have a kirby site which I took over from someone else and sometimes the Home page will throw this error
Kirby \ Exception \ NotFoundException (error.template.default.notFound)
The default template does not exist
When I log into the panel the page I had previously setup as my home page no longer appears as an available page. When I replace my local content folder with my remote content folder it seems to fix the issue, but only temporarily, because the issue represents itself again when I restart my MAMP server.
I’m using MAMP for local development and Codekit to compile Sass so maybe my configuration is messing with something but this is only affecting my Home page. Can I get some insight into how this error occurs so I can prevent it from happening?
Do you have a
default.php file in your templates folder? kirby uses this as a fallback if the desired template for a page cant be found. So if your content text file is called
about.txt and there is no
about.php in the templates folder, Kirby will try to use the
default.php file instead, but this also seems to be missing. Check your content files, i think both a desired template and the default template might be both missing.
It might be fixing it when you replace the content folder with another copy becase the content copy that you are using does not have content in it that is using a missing template.
Ah that’s really helpful thanks @jimbobrjames I’ve added the default.php because this seems like best practice but I’m still unsure why my home template is not being recognised by Kirby?
I’ve got a home.php template, a home.txt file inside /content/home so I’m a little lost as to why the template/content is not being recognised?
Are there any other txt files in the home folder that shouldn’t be there?