Previous Chapter | Up | Next Section | Contents

Editing DTML Methods


To edit a DTML Method, click on its name in the Folder's Contents List. The Edit view is the default view of the DTML Method, as shown below in Figure 50 . On the Edit screen there are fields to edit the DTML Method's title and source code (default source code shown here) and to change the size of the source code area. The new DTML syntax uses the format <dtml-var standard_html_footer> . The older DTML syntax <!--#var standard_html_footer--> that is shown in the "Edit DTML Method" is still valid.

DTML Method editing

 

The size of the object and the date the DTML Method was last modified is also provided. To commit a change to the DTML Method, simply click "Change". A dialog message appears informing either that the changes have been made, or that there are DTML errors.

New data may be uploaded from a local hard disk. This allows for the use of normal text editors to create DTML Methods. To upload new data, click on the Upload tag, then click the "Browse..." button to select the file to upload, and click "Change."

Stan wants to experiment with a DTML Method that will provide an user a message if they login the to the site but forgot their password. This DTML Method will email the user their password, if requested by the user. Copy the DTML script shown in Figure 51 into the source code area. There are several properties that have to be established before this method will work in this tutorial. It is only provided here to give you a place to start experimenting on your own.

 

DTML Method Mailing Password

DTML method for mailing back password in case user forgot

<dtml-var standard_html_footer>

 

<dtml-var standard_html_header>

<dtml-sendmail smtphost="localhost">

From: "Zope.org" <info@zope.org>

To: "<dtml-var full_name>" <<dtml-var email>>

Subject: Membership reminder

Your password: <dtml-var password>

Request made by IP <dtml-var "REQUEST.REMOTE_ADDR"> at <dtml-var ZopeTime></dtml-sendmail><p>

Your password has been mailed. It should arrive in your mailbox momentarily.</p><dtml-var standard_html_footer>

 

In order to see what a DTML Method looks like when it's rendered, click the View tab.

Previous Chapter | Up | Next Section | Contents

Banner.Novgorod.Ru