Include a tpl file with variables (Smarty)

Posted by user1640660 on Stack Overflow See other posts from Stack Overflow or by user1640660
Published on 2012-12-11T06:26:24Z Indexed on 2012/12/11 11:04 UTC
Read the original article Hit count: 167

Filed under:

I have a "links.tpl" file which contains lines with many variables such as below

{assign var=link_main value="index.php"}    
{assign var=link_login value="?a=login"}  

but when i include this file in home.tpl using {include file="file.tpl"} the variables {$link_main}, {$link_login} are not included

i put the {assign var=link_main value="index.php"} in home.tpl and it works but not from included file

i have tried adding scope=global to variable and parent to include but nothing happened

I tried the last few hours finding a solution, any help is appreciated

© Stack Overflow or respective owner

Related posts about smarty