smarty - Template inheritance: remove block that was added in grandparent and appended to in parent -
in smarty template, have 3 templates:
base.tpl
{block name="myblock"} base {/block}
child.tpl
{extends file="base.tpl"} {block name="myblock" append} child {/block}
grandchild.tpl
{extends file="child.tpl"} {block name="myblock"}{/block}
when rendering grandchild.tpl
, output is
base
so grandchild-template wants replace content of whole block, replaces appended part. how delete whole block?
related: how remove content appended block in parent template?
the solution here in child.tpl
change block definition from:
{block name="myblock" append} child {/block}
into:
{block name="myblock"} {$smarty.block.parent} child {/block}
Comments
Post a Comment