Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

{extends file="{$smarty.current_dir}/template.tpl"

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
traderookie
Smarty n00b


Joined: 02 Jul 2011
Posts: 1

PostPosted: Sat Jul 02, 2011 12:55 am    Post subject: {extends file="{$smarty.current_dir}/template.tpl" Reply with quote

Hi all!

I used Smarty 3.08 and wanted to inherit a template for my template file via {extends file="{$smarty.current_dir}/template.tpl"}

The above used to work but ended with the error message:
Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "templateChild.tpl" on line 2 "{extends file="{$smarty.current_dir}/template.tpl"}" a variable file attribute is illegal' in /www/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:441

I hope someone can help!
Back to top
View user's profile Send private message Send e-mail
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 674
Location: Germany, border to Switzerland

PostPosted: Sat Jul 02, 2011 8:43 am    Post subject: Reply with quote

This is a known issue. 3.08 (or 3.07?) restricted variables in the extends block, because Smarty cannot handle different inheritance paths from the same base template for you.

With Smarty 3.1 you can change that to {extends file="./template.tpl"} to achieve your goal
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP