[ZDP] BackTalk to Document The Zope Book (2.6 Edition)/Basic DTML

webmaster at zope.org webmaster at zope.org
Thu Mar 25 04:40:01 EST 2004

A comment to the paragraph below was recently added via http://zope.org/Documentation/Books/ZopeBook/2_6Edition/DTML.stx#3-11


      All DTML tags have *attributes*. An attribute provides
      information about how the tag is supposed to work. Some
      attributes are optional. For example, the *var* tag inserts the
      value of its target. It has an optional *missing* attribute that
      specifies a default value in case the variable can't be found::

        <dtml-var wingspan missing="unknown wingspan">

        % Chirael - Mar. 25, 2004 4:40 am:
         What happens if no missing attribute is given, but the variable isn't found. Is an exception thrown? Is an
         empty string returned instead? Is something logged in the error log? I have no idea, but I'd _imagine_ that
         the "better practice" would be to always provide a "missing" attribute, even if you never expect it to be
         missing, just for the sake of debugging and tracking down unexpected conditions.

More information about the ZDP mailing list