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 3.1.14: nested block problem

 
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
zardrell
Smarty Rookie


Joined: 28 Oct 2011
Posts: 7
Location: TOKYO / JAPAN

PostPosted: Thu Jul 25, 2013 3:08 pm    Post subject: Smarty 3.1.14: nested block problem Reply with quote

Hi.
I've got some problems when using nested block.

a.tpl
Code:

    {block name='body'}
        {block name='main'}{/block}
    {/block}



b.tpl extends a.tpl
Code:

    {block name='body'}
        {block name='main'}
            {$smarty.block.child}
            {block name='menu'}{/block}
        {/block}
    {/block}



and I got the following error:
Quote:

Syntax Error in template "b.tpl" on line xx "{/block}" unexpected closing tag.



then I edited b.tpl
Code:

    {block name='body'}
        {block name='main'}
            {block name='menu'}
                menu
            {/block}
            {$smarty.block.child}
        {/block}
    {/block}


c.tpl extends b.tpl
Code:

    {block main}
        From c.tpl
    {/block}


what I expected:
Code:

menu
From c.tpl


but instead the output is:
Code:

From c.tpl


If I change b.tpl to:
Code:

    {block name='body'}
        {block name='main'}
            {$smarty.block.child}
            {block name='menu'}
                menu
            {/block}
        {/block}
    {/block}


I will get
Code:

From c.tpl
menu
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Fri Jul 26, 2013 1:51 pm    Post subject: Reply with quote

The fix is now in the SVN trunk and will later be included in 3.1.15
Back to top
View user's profile Send private message
Lenchik
Smarty n00b


Joined: 13 Nov 2010
Posts: 4

PostPosted: Fri Aug 02, 2013 4:35 pm    Post subject: Reply with quote

Seems that this fix brokes some big sized (no particular "border" size found so far) named child blocks. If it helps: parent template was extended through php's
Code:
$smarty->display('extends:parent.tpl|'.$child_template_sourcepath);
Worked OK with r4757 version of smarty_internal_compile_block.php
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Fri Aug 02, 2013 7:10 pm    Post subject: Reply with quote

What type of failure do you geht? Which error message?
Back to top
View user's profile Send private message
Lenchik
Smarty n00b


Joined: 13 Nov 2010
Posts: 4

PostPosted: Fri Aug 02, 2013 7:44 pm    Post subject: Reply with quote

No error message. Just contents not "imported" from child block fully. Only hundred symbols or so. It "imports" reduced version completely, if i half reduce contents of child block for finding reason. But no "bordering" number (like 32000 symbols). No such problem until this fix applied.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Fri Aug 02, 2013 8:53 pm    Post subject: Reply with quote

Please see my private message for sending example templates.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Sat Aug 24, 2013 6:55 pm    Post subject: Reply with quote

The fix is now in the SVN trunk and will later be included in 3.1.15
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