|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
vorapoap Smarty Rookie
Joined: 22 Dec 2009 Posts: 32
|
Posted: Fri Dec 10, 2010 12:34 pm Post subject: {$smarty.block.xxxx} is not available when use extends: |
|
|
I have tested this.
It works if we use {extends file=...}
but not working for ->fetch("extends:....")
Are there any differences between this? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Dec 10, 2010 12:46 pm Post subject: |
|
|
There is no difference in handling of {extends } tags the the extends resource type. |
|
Back to top |
|
vorapoap Smarty Rookie
Joined: 22 Dec 2009 Posts: 32
|
Posted: Sat Dec 11, 2010 10:08 am Post subject: |
|
|
But the second one ->fetch("extends:")...
Smarty returns errors like this
Code: |
Exception SmartyCompilerException
Message Syntax Error in template "templates/pages/espiams/outer.tpl" on line 76 "{$smarty.block.parent}" $smarty.block is invalid' in D:\Data\WWW\espiams3\includes\libraries\smarty3\sysplugins\smarty_internal_templatecompilerbase.php:425
|
|
|
Back to top |
|
vorapoap Smarty Rookie
Joined: 22 Dec 2009 Posts: 32
|
Posted: Sat Dec 11, 2010 10:10 am Post subject: |
|
|
Code: |
{extends file="outer.tpl"}
{block name=dependency}
{if $PAGE.NAME != 'espiams'}
xxxxx
{/if}
{if $PAGE.NAME == 'espiams/app' || $PAGE.NAME == 'espiams/home'}
{$smarty.block.parent}
{/if}
{/block}
|
if the first line is omitted, the above error returns.. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Dec 11, 2010 11:48 am Post subject: |
|
|
I think you have used the wrong file order when unsing the extends resource.
It must be "extends:parent.tpl|child.tpl" |
|
Back to top |
|
vorapoap Smarty Rookie
Joined: 22 Dec 2009 Posts: 32
|
Posted: Sun Dec 12, 2010 12:21 am Post subject: |
|
|
Yaa! Thanks
Sorry for this..
That was my mistake! |
|
Back to top |
|
|
|
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
|