|
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 |
Tipo Smarty n00b
Joined: 19 Sep 2014 Posts: 4
|
Posted: Tue Sep 23, 2014 12:07 pm Post subject: How to overwrite a parent block that has an append? |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Sep 23, 2014 3:29 pm Post subject: |
|
|
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 |
|
Tipo Smarty n00b
Joined: 19 Sep 2014 Posts: 4
|
Posted: Wed Sep 24, 2014 6:39 am Post subject: |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Oct 01, 2014 9:05 pm Post subject: |
|
|
The bugfix is now in the SVN trunk and will later be included in 3.1.20 |
|
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
|