phpti
phpti copied to clipboard
Multiple blocks with same name... override them all
so you can do something like this...
parent.php:
<title>My Website Title | <?php emptyblock('title') ?></title>
<h1><?php emptyblock('title') ?></h1>
child.php:
<?php startblock('title') ?>Contact<?php endblock() ?>
however, there is an issue when superblock() is called and there are multiple parents (which superblock should it use?) but this feature might be worth it (maybe just choose the first superblock).
A way to do this is to render the content of the parent block at the specific overriden block, like happens with smarty:
parent.tpl
AAAA
{block "repeated"}
BBBB
{/block}
CCCCC
{block "repeated"}
DDDD
{/block}
EEEE
child.tpl
{block "repeated"}
Overriding <strong>{$smarty.block.parent}</strong> with FFFF
{/block}
The result would be:
AAAA Overriding BBBB FFFF CCCCC Overriding DDDD with FFFF EEEE