@layout.latte for Error Template

kodama
Member | 7
+
0
-

Hello Dave & the team, thank you for this awesome and beautiful framework and hello from Hong Kong. :)

I come from a Laravel background mainly, although I am familiar with the Fat Free Framework and Yii. Now just adding Nette to my arsenal of frameworks. Anyway, in the Nette docs it says you can copy the '@layout.latte' file into a template folder to override it using the default 'templates/@layout.latte' file.

This works, but doesn't seem to work for the ‘Error’ folder, it still uses the default.

Contact > @layout.latte works
About > @layout.latte' works
Error > @layout.latte' doesn't work

Is there something I am missing about the errors folder? I did try clearing the cache of course, but still the same.

Many thanks.

Last edited by kodama (2024-04-26 10:24)

Rick Strafy
Nette Blogger | 81
+
0
-

Hi, I'm not sure which skeleton are you using, because usually there is ErrorPresenter and Error4xxPresenter, I'm using different folders for both of them. ErrorPresenter should not render latte and should only have minimalistic php/html template with no dependencies on database etc. because you don't know what went wrong in your application – so you want minimal code that works.

For Error4xxPresenter it should be possible, it's also possible to set directly from the presenter like this https://github.com/…resenter.php#L18

David Grudl
Nette Core | 8228
+
+1
-

@kodama hello to Hong Kong :-) It should have been app/UI/@layout.latte in documentation, I fixed it. Then it should apply to all folders.

kodama
Member | 7
+
0
-

Thanks guys. Dave, appreciate the doc fix, thank you.