Implementation

For those who are interested in the implementation of this website I give the details here. I learned a lot about ZOPE by doing this site and I hope I can give you some of my experience via this page. I only give the specific parts for my site. For the basics of ZOPE please consult their website at http://www.zope.org. I specifically recommend the "Zope Book" to learn about DTML, scripting and Page Templates.

Layout with standard headers and footers

ZOPE provides an easy way to keep the look of pages the same for one site. You just include the line
<dtml-var standard_html_header>
at the top of every document and the line
<dtml-var standard_html_footer>
at the bottom of every document. Of course you have to provide appropriate files for the header and the footer. In my header file I open the main table that makes up my page layout.

The menu on the left side

Within the code for the standard header I also include the DTML-Method left_menu which looks like this
<h2>/<dtml-var expr="absolute_url(1)"></h2>

<ul class="linklist">
<dtml-if expr="string.count(absolute_url(1), '/')>0">
<dtml-if expr="string.count(absolute_url(1), '/')>1">
<li>&nbsp;<a href="/">Main</a></li>
</dtml-if>

<dtml-comment>This is some very evil code to extract
                the parent directory of the currently
                shown document.</dtml-comment>
<li class="upfolder"><a href="<dtml-var expr="'/'+absolute_url(1)[0:
              string.rfind('/'+absolute_url(1), '/', 0, 
              string.rfind('/'+absolute_url(1), '/')-1)]
              ">">Level Up</a></li>
</dtml-if>

<dtml-in prefix="loop" expr="getDocuments()">
  <dtml-if expr="loop_item.getProperty('publish', 0)">
    <dtml-comment>
      <dtml-if expr="loop_item.getProperty('german', 0)">
        <img src="site_images/swiss_german" alt="DOC_DE" />
      <dtml-else>
        <img src="site_images/document" alt="DOC" />
      </dtml-if>
    </dtml-comment>
    <li class="document"><a href="&dtml-absolute_url;"><dtml-var title></a></li>
  </dtml-if>
</dtml-in>
<dtml-in prefix="loop2" expr="getFolders()">
  <dtml-if expr="loop2_item.getProperty('publish', 0)">
    <li class="folder"><a href="&dtml-absolute_url;"><dtml-var title></a></li>
  </dtml-if>
</dtml-in>
</ul>

This code mainly provides the 'Mainpage' and the 'Level up' entries and iterates over all visible DTML documents and afterwars over all visible folders. As can be seen from the code visible means the property 'publish' of document resp. the folder is set. This has to be done manualy via the ZOPE managment interface.

If I now want to add a new document I simply chose the appropriate option from the managment interface and keep most of the provided code in the given template. When I believe the page to be ok, I simply set the publish property to true and it will apear in the menu listing of the containing folder. Similarily can I add a new folder by chosing the appropriate option in the managment interface and setting the publish property.