Zope
  Home arrow Zope arrow Page 3 - DTML Basics (part 1)
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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 1)
By: Harish Kamath, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 9
    2002-05-21


    Table of Contents:
  • DTML Basics (part 1)
  • Upper Management
  • Dissecting DTML
  • Of Methods And Madness
  • Introducing Yourself
  • Green Cheese And Pink Frogs

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    DTML Basics (part 1) - Dissecting DTML
    ( Page 3 of 6 )

    Let's take a closer look at the DTML code which generated the screen on the previous page.


    <dtml-var standard_html_header> <h2><dtml-var title_or_id></h2> <p> This is the <dtml-var id> Document. </p> <dtml-var standard_html_footer>
    As you can see, this code block contains both HTML and DTML. When Zope processes this DTML Document instance, the DTML tags within it will be processed, and will be replaced with the resulting output. If you're familiar with PHP, JSP or ASP, this tag-based approach should already be familiar to you.

    The first line of code

    <dtml-var standard_html_header>
    merely inserts the value of the DTML variable named "standard_html_header". This is one of the few predefined variables available in Zope, and, as the name suggests, it is used to display a common header for your site.

    Next, the lines

    <h2><dtml-var title_or_id></h2> <p> This is the <dtml-var id> Document. </p>
    fetch and display either the document's title or its ID. If no title is available (as is the case here, since I never specified one when I created the object), Zope will make do with the ID.

    Finally, the line

    <dtml-var standard_html_footer>
    inserts the value of another predefined Zope variable, "standard_html_footer". No prizes for guessing what this one's used for!

    Obviously, you can just as easily omit all the DTML code and use a static HTML document - like this one:

    <html> <head> <basefont face="Arial"> </head> <body> <h2>Can you say dee tee em el?</h2> </body> </html>
    Zope will look for DTML tags within it and, finding none, will simply render the HTML as is.



     
     
    >>> 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-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    Stay green...Green IT