[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=&lt;slot-name&gt;
 </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">&lt;html</span> <span class="na">metal:define-macro=</span><span class="s">&quot;mypage&quot;</span><span class="nt">&gt;</span>
   <span class="nt">&lt;head&gt;&lt;/head&gt;</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=&quot;&lt;slot-name&gt;&quot;</blockquote>
+the same macro. You can fill slots using:</p>
+<pre class="literal-block">
+metal:fill-slot=&quot;&lt;slot-name&gt;&quot;
+</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">&lt;html</span> <span class="na">metal:use-macro=</span><span class="s">&quot;context/&#64;&#64;mymacros/mypage&quot;</span><span class="nt">&gt;</span>
   <span class="nt">&lt;body&gt;</span>
-    <span class="c">&lt;!-- slot 'mybody' was defined in the macro above --&gt;</span>
-    <span class="nt">&lt;div</span> <span class="na">metal:fill-slot=</span><span class="s">&quot;mybody&quot;</span><span class="nt">&gt;</span>
+    <span class="c">&lt;!-- slot 'mycontent' was defined in the macro above --&gt;</span>
+    <span class="nt">&lt;div</span> <span class="na">metal:fill-slot=</span><span class="s">&quot;mycontent&quot;</span><span class="nt">&gt;</span>
       My content from index.pt
     <span class="nt">&lt;/div&gt;</span>
   <span class="nt">&lt;/body&gt;</span>



More information about the Checkins mailing list