« Python, Distutils and SWIG | Main | ping doesn't work »

16 March 2004

Reusing COREBlog DTML widgets in ZPT

Context: COREBlog templating is implemented in DTML. DTML is deprecated. The new Zope standard for templating is ZPT.

The non-blog content on this site uses a ZPT called standard_page. The original template renders a menu (defined in another ZPT called menu) in a table cell thusly:

<td>
<table metal:use-macro="here/menu/macros/menu"></table>
</td>

To replace the menu with the COREBlog sidebar:

1. Create a DTML Document called blog_sidebar within the COREBlog 'Contents' view, i.e., at the same level as blog_banner,blog_footer, etc.

<dtml-comment>### Sidebox block ###</dtml-comment>
<div id="sidebox">
<dtml-with modules>
<dtml-var index_html>
</dtml-with>
</div>

(This is refactored out of COREBlog's default index_html directly.)

2. In the ZPT standard_page, replace the call to the 'menu' macro:

<td>
<div tal:replace="structure here/blog_sidebar">Blog Sidebar</div>
</td>

Here's what an existing page looks like. Only the ZPT has been changed as described above; the content is untouched.


Posted by ngps at 13:53 | Comments (0) | Trackbacks (0)
Comments
There is no comment.
Trackbacks
Please send trackback to:http://sandbox.rulemaker.net/ngps/7/tbping
There is no trackback.