Zope
  Home arrow Zope arrow Page 8 - 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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    DTML Basics (part 4) - The Writing On The Wall
    (Page 8 of 9 )

    Now, every major programming language comes with the capability to include inline comments in the code. And DTML lets you include meaningful comments in your code via the <dtml-comment> tag. Take a look at the tree example, now rewritten with lots of comments.

    <dtml-tree branches_expr="objectValues()" sort="id" single="1"> <dtml-comment> check if the current item in the tree is a folder</dtml-comment> <dtml-if "meta_type=='Folder'"> <dtml-comment>If folder, just display the id</dtml-comment> <img src="<dtml-var icon>" > <dtml-comment>check if current item has been expanded</dtml-comment> <dtml-if tree-item-expanded> <dtml-comment> if expanded, display the id of the object in bold</dtml-comment> <b><dtml-var getId></b> <dtml-else> <dtml-var getId> </dtml-if> <dtml-else> <dtml-comment>if not folder, hyperlink the object so that it can be directly accessed by the user</dtml-comment> <img src="<dtml-var icon>"> <a href="<dtml-var tree-item-url>"> <dtml-var getId> </a> </dtml-if> </dtml-tree>
    If you're planning to make your code publicly available on the Internet, a comment is a great way to tell members of the opposite sex all about yourself - try including your phone number for optimum results.

    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 6 hosted by Hostway