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

How to overwrite a parent block that has an append?

 
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 -> General
View previous topic :: View next topic  
Author Message
Tipo
Smarty n00b


Joined: 19 Sep 2014
Posts: 4

PostPosted: Tue Sep 23, 2014 12:07 pm    Post subject: How to overwrite a parent block that has an append? Reply with quote

Hi,

I have a problem that I can't overwrite a parent block that uses an append.

For example:
// index_index
{block name="main"}
This is the main.
{/block}

// other_index
{block name="main" append}
This is the other main.
{/block}

// other_other_index
{block name="main"}
This is the other other main.
{/block}

When I try this the other_index seems to has a higher priority because I can't overwrite it with my last other_other_index.
But when I delete the "append" everything works fine.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Tue Sep 23, 2014 3:29 pm    Post subject: Reply with quote

When I assume:

// index_index
{block name="main"}
This is the main.
{/block}

// other_index
{extends 'index_index.tpl'
{block name="main" append}
This is the other main.
{/block}

// other_other_index
{extends 'other_index.tpl'
{block name="main"}
This is the other other main.
{/block}

and I call other_other_index

it works as expected and the output is "This is the other other main. "

Or how did you call the templates?
Back to top
View user's profile Send private message
Tipo
Smarty n00b


Joined: 19 Sep 2014
Posts: 4

PostPosted: Wed Sep 24, 2014 6:39 am    Post subject: Reply with quote

Good morning,

that is exactly the way I do.
The only difference is that the second block "other_index" first extends the parent and second append his own block. And now when the last block is called it only overwrites "other_index" but not the appended content.

So my result is always:
Code:
This is the main.
This is the other other main.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Wed Oct 01, 2014 9:05 pm    Post subject: Reply with quote

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