[Checkins] SVN: grok/www/minitutorials/macros.html Updated changed
macros tutorial.
Uli Fouquet
uli at gnufix.de
Tue Aug 28 11:31:05 EDT 2007
Log message for revision 79308:
Updated changed macros tutorial.
Changed:
U grok/www/minitutorials/macros.html
-=-
Modified: grok/www/minitutorials/macros.html
===================================================================
--- grok/www/minitutorials/macros.html 2007-08-28 15:25:33 UTC (rev 79307)
+++ grok/www/minitutorials/macros.html 2007-08-28 15:31:05 UTC (rev 79308)
@@ -99,7 +99,7 @@
<pre class="literal-block">
metal:define-slot=<slot-name>
</pre>
-<p>Let's define a very plain page macro:</p>
+<p>Let's define a very plain page macro in <tt class="docutils literal"><span class="pre">app_templates/mymacros.pt</span></tt>:</p>
<pre class="code-block html literal-block">
<span class="nt"><html</span> <span class="na">metal:define-macro=</span><span class="s">"mypage"</span><span class="nt">></span>
<span class="nt"><head></head></span>
@@ -151,16 +151,17 @@
<tt class="docutils literal"><span class="pre">mymacros</span></tt> in browser, but <tt class="docutils literal"><span class="pre">index</span></tt>. That's what macros are made
for.</p>
<p>When we fill the slots, we get different content rendered within
-the same macro. You can fill slots using</p>
-<blockquote>
-metal:fill-slot="<slot-name>"</blockquote>
+the same macro. You can fill slots using:</p>
+<pre class="literal-block">
+metal:fill-slot="<slot-name>"
+</pre>
<p>where the slot-name must be defined in the macro. Now, change
<tt class="docutils literal"><span class="pre">index.pt</span></tt> to:</p>
<pre class="code-block html literal-block">
<span class="nt"><html</span> <span class="na">metal:use-macro=</span><span class="s">"context/@@mymacros/mypage"</span><span class="nt">></span>
<span class="nt"><body></span>
- <span class="c"><!-- slot 'mybody' was defined in the macro above --></span>
- <span class="nt"><div</span> <span class="na">metal:fill-slot=</span><span class="s">"mybody"</span><span class="nt">></span>
+ <span class="c"><!-- slot 'mycontent' was defined in the macro above --></span>
+ <span class="nt"><div</span> <span class="na">metal:fill-slot=</span><span class="s">"mycontent"</span><span class="nt">></span>
My content from index.pt
<span class="nt"></div></span>
<span class="nt"></body></span>
More information about the Checkins
mailing list