mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
0d599cb211
and added documentation for {parent}
1.2 KiB
1.2 KiB
Tag {extends}
{extends}
tags are used in child templates in template inheritance for extending parent templates.
The {extends}
tag must be on before any block.
Also if a child template extends a parent template with the {extends}
tag it may contain only {block}
tags. Any other template content is ignored.
{extends}
{extends 'parent.tpl'}
{block}
{block 'bk2'}content 2{/block}
{use}
Import the blocks defined in another file. Specifying blocks in this template will override those from the other file.
{use 'blocks.tpl'} merge blocks from blocks.tpl template
{block 'alpha'} rewrite block alpha from blocks.tpl template, if it exists
...
{/block}
{parent}
Uses the code from the block as defined in the parent.
{extends 'parent.tpl'}
{block 'header'}
content ...
{parent} pase code from block 'header' from parent.tpl
content ...
{/block}
{paste}
Pastes the code of any block
{block 'b1'}
...
{/block}
{block 'b2'}
...
{paste 'b1'} paste code from b1
{/block}
{$.block}
Checks if clock exists
{if $.block.header}
block header exists
{/if}