Next Chapter | Up | Next Section | Contents

Creating Zope Applications using DTML Scripts


A Zope application is simply a collection of Zope objects that solves a particular problem.

To illustrate the use of Zope applications, we will use a very simple website application. The simple website application, in this example, consists of a folder (Figure 16 ) containing an index_html DTML Method (Figure 17 ) and a logo. The source code of the index_html DTML Method uses several properties that are defined in the folder (Figure 18 ). When the Home folder is visited by a browser, the index_html DTML Method is rendered to display the home page shown in Figure 19 .

Simple website application folder

 

Create a folder under Products with the "id" Home and "title" Products Home Page. Add a logo for the Products department. Go to the index_html edit page shown in figure 17. Change the information in the html document with the follow:

index_html DTML Method

 

<dtml-var standard_html_header>

<dtml-var logo>

<H2><dtml-var company_name></H2>

<dtml-var message>

<HR>

For more information, contact us at <em>

<dtml-var contact_phone></em>

<dtml-var standard_html_footer>

Now we have a simple web page set up for the research department, but the dtml-var objects have not been defined. In figure 18, the properties can be added to the Home folder. Click on the properties object tag for Home. As a DTML Method, it will access the properties from the folder it resides or higher up the hierarchy. To add a property, enter the "id" message , type in the message shown in the figure18. Continue adding properties for the above html, you will need a company name and a contact phone .

Folder properties used by the simple website application

 

After creating the Products web site, open another web browser and view your masterpiece. Creating the properties allows changes to the appearance of the site without having to change its HTML. .

The home page displayed by the simple website application

 

 

Stan has completed his two tasks. He has created a public website for the Products, Research and Public Relations (News) departments. The second task of giving individuals the ability to change manage their own department's content has been established.

Next Chapter | Up | Next Section | Contents

Banner.Novgorod.Ru