summaryrefslogtreecommitdiff
path: root/docs/designers/language-builtin-functions/language-function-extends.md
diff options
context:
space:
mode:
authorSimon Wisselink <wisskid@users.noreply.github.com>2021-12-03 11:59:22 +0100
committerGitHub <noreply@github.com>2021-12-03 11:59:22 +0100
commit428a701b1871b02078a663d51a9a6555195743b3 (patch)
tree51a76b654fb742dd9ea1ee6595baa27f113bc7ca /docs/designers/language-builtin-functions/language-function-extends.md
parentbaebd59bb4da9fca89da382811b38c8313949c49 (diff)
downloadsmarty-428a701b1871b02078a663d51a9a6555195743b3.tar.gz
smarty-428a701b1871b02078a663d51a9a6555195743b3.tar.bz2
smarty-428a701b1871b02078a663d51a9a6555195743b3.zip
Feature/add docs (#689)
* Add converted docs repo * Set theme jekyll-theme-minimal * Removed BC docs, added TOC * Added TOCs, rewrote most important links in documentation. Linked README to new Github Pages site * some link fixes
Diffstat (limited to 'docs/designers/language-builtin-functions/language-function-extends.md')
-rw-r--r--docs/designers/language-builtin-functions/language-function-extends.md37
1 files changed, 37 insertions, 0 deletions
diff --git a/docs/designers/language-builtin-functions/language-function-extends.md b/docs/designers/language-builtin-functions/language-function-extends.md
new file mode 100644
index 00000000..9559e7c5
--- /dev/null
+++ b/docs/designers/language-builtin-functions/language-function-extends.md
@@ -0,0 +1,37 @@
+{extends} {#language.function.extends}
+=========
+
+`{extends}` tags are used in child templates in template inheritance for
+extending parent templates. For details see section of [Template
+Interitance](#advanced.features.template.inheritance).
+
+- The `{extends}` tag must be on the first line of the template.
+
+- If a child template extends a parent template with the `{extends}`
+ tag it may contain only `{block}` tags. Any other template content
+ is ignored.
+
+- Use the syntax for [template resources](#resources) to extend files
+ outside of the [`$template_dir`](#variable.template.dir) directory.
+
+> **Note**
+>
+> When extending a variable parent like `{extends file=$parent_file}`,
+> make sure you include `$parent_file` in the
+> [`$compile_id`](#variable.compile.id). Otherwise Smarty cannot
+> distinguish between different `$parent_file`s.
+
+**Attributes:**
+
+ Attribute Name Type Required Default Description
+ ---------------- -------- ---------- --------- -------------------------------------------------
+ file string Yes *n/a* The name of the template file which is extended
+
+
+ {extends file='parent.tpl'}
+ {extends 'parent.tpl'} {* short-hand *}
+
+
+
+See also [Template Interitance](#advanced.features.template.inheritance)
+and [`{block}`](#language.function.block).