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

{$smarty.block.xxxx} is not available when use extends:

 
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 -> Bugs
View previous topic :: View next topic  
Author Message
vorapoap
Smarty Rookie


Joined: 22 Dec 2009
Posts: 32

PostPosted: Fri Dec 10, 2010 12:34 pm    Post subject: {$smarty.block.xxxx} is not available when use extends: Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Fri Dec 10, 2010 12:46 pm    Post subject: Reply with quote

There is no difference in handling of {extends } tags the the extends resource type.
Back to top
View user's profile Send private message
vorapoap
Smarty Rookie


Joined: 22 Dec 2009
Posts: 32

PostPosted: Sat Dec 11, 2010 10:08 am    Post subject: Reply with quote

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
View user's profile Send private message
vorapoap
Smarty Rookie


Joined: 22 Dec 2009
Posts: 32

PostPosted: Sat Dec 11, 2010 10:10 am    Post subject: Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat Dec 11, 2010 11:48 am    Post subject: Reply with quote

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
View user's profile Send private message
vorapoap
Smarty Rookie


Joined: 22 Dec 2009
Posts: 32

PostPosted: Sun Dec 12, 2010 12:21 am    Post subject: Reply with quote

Yaa! Thanks

Sorry for this..
That was my mistake!
Back to top
View user's profile Send private message
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 -> Bugs 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