[Zope-CVS] CVS: Products/CompositePage/www - metal_template.zpt:1.1 addCompositeForm.zpt:1.3

Shane Hathaway shane at zope.com
Sat Oct 4 14:10:06 EDT 2003


Update of /cvs-repository/Products/CompositePage/www
In directory cvs.zope.org:/tmp/cvs-serv22368/www

Modified Files:
	addCompositeForm.zpt 
Added Files:
	metal_template.zpt 
Log Message:
Added support for composite templating based on METAL macros.

Now, instead of:

  <div tal:repeat="element here/slots/foo/multiple"
    tal:content="structure element" />

you can use:

  <div metal:define-slot="foo" />

To accomplish this, the composite generates a TAL program and executes 
it using the standard TALIntepreter.



=== Added File Products/CompositePage/www/metal_template.zpt ===
<html metal:define-macro="page">
  <head>
    <title tal:content="template/title">The title</title>
  </head>
  <body>

<table border="4" width="100%">
<tr>
<th colspan="3">
<h2>
METAL-Based Composite Page Example
</h2>
</th>
</tr>
<tr>

<td width="25%" valign="top">
Left column
<div metal:define-slot="left">
Element here...
</div>
</td>

<td width="50%" valign="top">
Middle column
<div metal:define-slot="middle">
Element here...
</div>
</td>

<td width="50%" valign="top">

Small ad

<table border="1" width="100%">
<tr>
<td>
<div metal:define-slot="small_ad">
&nbsp;
</div>
</td>
</tr>
</table>

Right column
<div metal:define-slot="right">
Element here...
</div>
</td>

</tr>

</table>

<br />

<div align="center">
Copyrights and trademarks
<div metal:define-slot="bottom"></div>
</div>

  </body>
</html>


=== Products/CompositePage/www/addCompositeForm.zpt 1.2 => 1.3 ===
--- Products/CompositePage/www/addCompositeForm.zpt:1.2	Wed Oct  1 14:59:32 2003
+++ Products/CompositePage/www/addCompositeForm.zpt	Sat Oct  4 14:10:06 2003
@@ -33,11 +33,17 @@
   <tr>
     <td align="left" valign="top">
     <div class="form-optional">
-    Create sample template
+    Create sample template:
     </div>
     </td>
     <td align="left" valign="top">
-    <input type="checkbox" name="create_sample" checked="checked" />
+    <input type="radio" name="create_sample"
+      value="sample_template.zpt" checked="checked" />
+      Standard (uses "here/slots/name/multiple" TAL expressions)<br />
+    <input type="radio" name="create_sample"
+      value="metal_template.zpt" />
+      METAL (uses METAL macros and slots)<br />
+    <input type="radio" name="create_sample" value="" /> None
     </td>
   </tr>
   <tr>




More information about the Zope-CVS mailing list