1

i have a base template that calls a nested template based on a variable passed in, eg.

page = 6

and what i want is to call some html as follows:

...
<div>
    #include "templates/_page${page}.tmpl"
</div>
...

what is the correct syntax for this? thanks.

PS. i have managed this:

#if $page.id == 6
    #include "templates/_page6.tmpl"
#end if

but any improvement welcome

khany
  • 1,167
  • 15
  • 33

1 Answers1

2

well, all it took was a few nights sleep but i got a solution:

#include "templates/_page"+str($page)+".tmpl"

i slightly expanded the code and it works. HTH

khany
  • 1,167
  • 15
  • 33