i change order of parent blocks in child templates while using content of parent blocks.
example:
parent template:
{block outer} {block a} ... long content ...{/block} {block b} ... long content ...{/block} {block c} ... long content ...{/block} {/block} child template:
{extends file="parent:parent.tpl"} {block outer} {block c} reuse content of parent block "c" {/block} {block b} reuse content of parent block "b" {/block} {block a} reuse content of parent block "a" {/block} {/block} i tried using {$smarty.block.parent} inside block a, b , c:
{extends file="parent:parent.tpl"} {block outer} {block c} {$smarty.block.parent} {/block} {block b} {$smarty.block.parent} {/block} {block a} {$smarty.block.parent} {/block} {/block} in case {$smarty.block.parent} contains content of parent block "outer".
is possible render content of inner blocks a, b , c inside child template?
scenario: contents of blocks a, b , c complex , want avoid copying , pasting whole contents parent.
though old post might important future.
best attempt @ solving issue following:
{extends file="parent:parent.tpl"} {block a} {capture a} {$smarty.block.parent} {/capture} {/block} {block c} {capture c} {$smarty.block.parent} {/capture} {/block} {block b} {$smarty.capture.c} {$smarty.block.parent} {$smarty.capture.a} {/block}
Comments
Post a Comment