Zope
  Home arrow Zope arrow Page 4 - DTML Basics (part 4)
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ZOPE

DTML Basics (part 4)
By: Harish Kamath, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 5
    2002-07-17

    Table of Contents:
  • DTML Basics (part 4)
  • With Or Without You
  • A Polite Request
  • Let Me In
  • Climbing A Tree
  • The Real Thing
  • Call Of The Wild
  • The Writing On The Wall
  • Endzone

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Dell PowerEdge Servers

    DTML Basics (part 4) - Let Me In
    (Page 4 of 9 )

    You've just seen how to push existing objects to the top of the namespace. But what if you want to create a new DTML object or variable? How do you push that newly-minted variable in to the DTML namespace?

    The <dtml-let> tag is designed for just this kind of thing. Here's an example:

    <dtml-let me="'John Doe'" > I am <dtml-var me>. </dtml-let>
    The output of the script is pretty obvious:

    I am John Doe
    The <dtml-let> tag has been used to push a new variable, "me", to the top of the namespace. You can now access the value for this variable without even passing it as part of the query string. This is an effective way of debugging complicated DTML methods which require numerous parameters in the form data; just push them on to the namespace using the <dtml-let> tag, test your code, and, once you're done, delete the <dtml-let> tag!

    You can also push objects on to the namespace. As an example, consider the process of pushing the GetUsers() ZSQL Method on to the namespace:

    <dtml-let users=GetUsers> <dtml-in users> <dtml-var sequence-number>. <dtml-var Title> <dtml-var FirstName> <dtml-var Surname> - <dtml-var Email> </dtml-in> </dtml-let>
    This example pushes the sequence returned by the GetUsers() ZSQL methods on to the namespace. The new "users" variable can then be processed as usual with the <dtml-in> tag.

    More Zope Articles
    More By Harish Kamath, (c) Melonfire


     

       

    ZOPE ARTICLES

    - Creating Zope Products
    - Plone Content Types With Archetypes
    - Flat User Management in Zope
    - Creating Basic Zope Applications
    - Getting started with Zope for Linux and Sola...
    - ZPT Basics (part 4)
    - ZPT Basics (part 3)
    - ZPT Basics (part 2)
    - ZPT Basics (part 1)
    - Exception Handling In DTML
    - DTML Basics (part 4)
    - DTML Basics (part 3)
    - DTML Basics (part 2)
    - DTML Basics (part 1)
    - Using Zope With Apache




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway