You are not logged in Log in Join
You are here: Home » Members » ivo » tag product

Log in
Name

Password

 
 

Folder icon <dtml-set> tag product

dtml-set (c) Ivo van der Wijk, Amaze Internet Services ([email protected])

What does it do? ----------------

This product implements a tag that enables dtml coders to set variables transparently. It basically replaces those ugly (and error prone) calls.

It also provides an optional tag, which will only do the assignment if the target variable previously didn't exist, previously equivalent to:

Why not dtml-let? -----------------

dtml-let requires a block, which can be usefull to keep the changed namespace local and clean, but it makes it really hard to make a variable available in your entire dtml document/method.

Why not dtml-eval? ------------------

dtml-eval (another similar external product) requires a block structure. Assignments within this blockstructure are global within your dtml document/ method, but I like the shorter dtml-set notation. Also, it lacks the optional tag.

Examples --------

  • set some variables

    (assigns previously set j to q)

    (only assings if name was undefined)

    (will print 25)

Pitfalls ---------

Assigning a string has to be done using a python expression, which has to be enclosed in "", i.e.

dtml-set is not limited by the scope of other tags, i.e.

Will work fine.

TODO list ---------

  • Some code cleanups, regular expression optimizations - Rewrite this document in structured text format - works without warning. - the behaviour is undefined if optional is not placed at the end.

 Title   Type   Size   Modified   Status 
 Release 1.0 (Zope 2.4 only) Edit object Software Release   2001-07-18 published
 Release 1.0.1 (Contains fix for latest 2.4 releases) Edit object Software Release   2001-07-19 published
 Set Tag Product Download Edit object Software Release   2001-06-27 published
 SetTag 1.0 (Zope 2.4) released Edit object News Item 1 K 2001-07-18 published