How to include template at the top of the file and use it below

MikeJenis
Member | 1
+
0
-

Hey guys. I have FE/react background and that's why this question. Why couldn't I/or how could I import path to a template at the top of the *.latte file and then used this named include (import)? It just seems to me as a more readable and controlled way of including templates, but again this may be because of my ‘outsider’ look on this issue. Thank you

Rick Strafy
Nette Blogger | 21
+
0
-

Try

{var $testLatte = '@Includes/test.latte'}

and then somewhere in the file

{include $testLatte}

but maybe that's not what you are looking for, check the docs https://latte.nette.org/…-inheritance, because there is a lot of ways how this can be achieved

Last edited by Rick Strafy (2021-09-19 23:41)