0

After creating a new theme using devtools:

  • Renamed user/pages/01.home/default.md to home.md
  • Copied default.html.twig in user/themes/xyz/templates to home.html.twig

Expected no change at all, cause I haven't changed the twig-file. I get an error instead:

Template home.html.twig is not defined.

But the file exists!? I'm using grav-admin 1.3.1, PHP 7.1.0 on Win10.

Jacobm001
  • 4,431
  • 4
  • 30
  • 51
user414873
  • 741
  • 8
  • 20
  • Nice! if you have any specific questions let us know. For now I'm flagging this as off-topic, as it's not clear what you are asking. Please refer to [How to ask a good question?](https://stackoverflow.com/help/how-to-ask). Have you tried to do any research? What have you tried? Questions here should have a clear problem/question, with research shown, and a [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/mcve) example. – GrumpyCrouton Jul 21 '17 at 15:00
  • @GrumpyCroutron: This IS a specific question. Have you understood the problem at all? – user414873 Jul 21 '17 at 15:04
  • You should read my comment. Specifically "Have you tried to do any research? What have you tried? Questions here should have a clear problem/question, **with research shown, and a Minimal, Complete, and Verifiable example.**" – GrumpyCrouton Jul 21 '17 at 15:06
  • @GrumpyCrouton: Asking for an example of renaming 2 files is ridiculous. You haven't read the question at all! I don't have to proof you, that I did reasearch either. Is this court or an Q&A site? – user414873 Jul 21 '17 at 15:14
  • Good luck getting help if you aren't going to follow site guidelines. – GrumpyCrouton Jul 21 '17 at 15:15
  • 1
    Could you show us the frontmatter of the page and the structure of your folders ? (pages and templates) – Amaury Hanser Jul 22 '17 at 21:35
  • The problem was described in details. This is a question with enough information to answer. – Hung Tran Aug 19 '17 at 07:31

1 Answers1

0

Experience would suggest that it's one of three things.

  1. A caching issue. Try clearing the site cache and trying again.

  2. A naming issue. Did you copy home.html.twig to the same directory as the default.html.twig file? Double check that the names align properly, and you haven't accidentally inserted a space.

  3. Who owns the new home.html.twig file? If ls -l lists the owner as anything other than the web user, you probably need to use chown to change the ownership to the web user.

Short of that, it would be difficult to offer better advice without seeing the code directly.

Jacobm001
  • 4,431
  • 4
  • 30
  • 51
  • The problem should be caused by cache or permission or wrong folder. He/she already mentioned that he/she didn't modify the content of the files. Even if he/she did that and messed up something, we would get a different error. – Hung Tran Aug 19 '17 at 07:34
  • I can reproduce this problem if cache is enabled. @user414873 you should clear the cache after renaming the files. If the site is in development, turn off cache unless you want to clear cache every time you make some changes. – Hung Tran Aug 19 '17 at 07:37