ravin
ravin

Reputation: 31

Including Smarty templates from sub-folders using relative paths

I have created a folder structure for smarty templates

f 
.f1 
..template1.tpl 
..test.tpl 
template1.tpl 

the template_dir path is pointed to folder 'f/'

in test.tpl is the code below

{include file="template1.tpl"} 
{include file="../template1.tpl"} 

This code does not work. Any idea where I might be going wrong?

I read about $smarty-> use_sub_dirs = true, which did create subfolders in my template_c folder but I'm still not able to include templates as per the above code.

Thanks in advance.

Upvotes: 3

Views: 1338

Answers (1)

syrkull
syrkull

Reputation: 2344

just add f1 to your URL

{include file="f1/template1.tpl"}

Upvotes: 4

Related Questions