diff options
-rw-r--r-- | docu/language_definition.html | 22 | ||||
-rw-r--r-- | example/templates/src/articles.html | 10 | ||||
-rw-r--r-- | example/templates/src/base.html (renamed from example/templates/src/master.html) | 0 |
3 files changed, 16 insertions, 16 deletions
diff --git a/docu/language_definition.html b/docu/language_definition.html index c99a4b9..20ba5dc 100644 --- a/docu/language_definition.html +++ b/docu/language_definition.html @@ -407,29 +407,29 @@ <p>This self-closing tag loads and executes another template. The <code>name</code> parameter (mandatory) defines the template to load.</p> <p>Because each template must be parseable and compilable by itself, this is not a inclusion of another template. So you can not do this:</p> <p> - slave.tpl:<br /> + sub.tpl:<br /> <code><pre><ste:foo><br /> bla</pre></code> - master.tpl<br /> -<code><pre><ste:load name="slave.tpl" /><br /></ste:foo></pre></code> + base.tpl<br /> +<code><pre><ste:load name="sub.tpl" /><br /></ste:foo></pre></code> </p> <p>But you can do this:</p> <p> - slave.tpl:<br /> + sub.tpl:<br /> <code><pre><ste:foo>$bar</ste:foo></pre></code> - master.tpl<br /> -<code><pre><ste:baz><br /> <ste:load name="slave.tpl" /><br /></ste:baz></pre></code> + base.tpl<br /> +<code><pre><ste:baz><br /> <ste:load name="sub.tpl" /><br /></ste:baz></pre></code> </p> <h3 id="builtin_block">ste:block</h3> - <p>ste:block provides an easy way for writing master templates. Every block has a name. When a block is defined twice, the second one will overwrite the first one.</p> + <p>ste:block provides an easy way for writing base templates. Every block has a name. When a block is defined twice, the second one will overwrite the first one.</p> <p>The name can be set with the <code>name</code> parameter.</p> <p> Example:<br /> - master.tpl + base.tpl <code><pre><h1>Content:</h1><br /><ste:block name="content"><br /> Default content<br /></ste:block><br /><div class="sidebar"><br /> <ste:block name="sidebar"><br /> Default sidebar<br /> </ste:block><br /></div></pre></code> - slave.tpl:<br /> -<code><pre><ste:load name="master.tpl" /><br /><ste:block name="content"><br /> Much cooler content :-)<br /></ste:block></pre></code> - When executing slave.tpl, master.tpl will be loaded and its <code>content</code> block will be replaced with the new one (<code>Much cooler content :-)</code>) but leave the original <code>sidebar</code> block. + sub.tpl:<br /> +<code><pre><ste:load name="base.tpl" /><br /><ste:block name="content"><br /> Much cooler content :-)<br /></ste:block></pre></code> + When executing sub.tpl, base.tpl will be loaded and its <code>content</code> block will be replaced with the new one (<code>Much cooler content :-)</code>) but leave the original <code>sidebar</code> block. </p> <p>Blocks can not be nested.</p> diff --git a/example/templates/src/articles.html b/example/templates/src/articles.html index 36f59c4..270eb00 100644 --- a/example/templates/src/articles.html +++ b/example/templates/src/articles.html @@ -1,5 +1,5 @@ <ste:load name="custom_tags.tpl" /> -<ste:load name="master.html" /> +<ste:load name="base.html" /> <ste:comment>Lets overwrite the content section</ste:comment> <ste:block name="content"> <h2>Some Articles</h2> @@ -29,7 +29,7 @@ <p>There are <a href="#">more articles</a>.</p> </ste:then> </ste:if> - + <h2>Some more useless demo stuff...</h2> <h3>Counting from 10 to 0...</h3> <p>but take only the even ones and multiply by 5...</p> @@ -41,15 +41,15 @@ </ste:then> </ste:if> </ste:for> - + <h3>Repeat some text...</h3> <ste:repeat n="10"> <p>Bla</p> </ste:repeat> - + <h3>Get a variable's content dynamically</h3> <ste:get var="${foo}[$bar]" /> - + <h3>We will call ste:repeat with a non-numerical value for n here to see the handling of a RuntimeError</h3> <ste:repeat n="lol"> <p>Bla</p> diff --git a/example/templates/src/master.html b/example/templates/src/base.html index fe6b1e6..fe6b1e6 100644 --- a/example/templates/src/master.html +++ b/example/templates/src/base.html |