[ZPT] Sanity Patch

seb bacon seb@jamkit.com
12 Mar 2002 16:02:46 +0000


On Tue, 2002-03-12 at 15:53, Ron Bickers wrote:
> > Turning off this setting by default would be bad
> > though, because one of the main points of ZPT is to
> > allow editing of templates by WYSIWYG tools. These
> > tools, unfortunately, do not work right unless the
> > macros are expanded.
> 
> Not true for me.  I use expand=0 with DW for everything.  All of my pages
> are complete valid documents, I just don't have the benefit (clutter) of the
> expanded part of the pages when I edit them.

I only recently started using zpt 'full-time.'  The question of best
practice has been bothering me somewhat, and the comments above make it
clear that TWTOWTDI.

Here's my approach.  ZPTatistas, please comment:

I make sure every page I create is a valid document.  Generally, I
create libraries of macro 'routines' for HTML snippets which are reused
regularly.  

As an example, I'm doing a forms-heavy, online survey.  Of course, it
uses a number of form elements (textarea, dropdown, input, etc).  I have
parameterised these and put them as individual macros in a library
template.  You can view the library template in an editor, and it has
comments next to each element ("this is a standard textarea widget"), so
you know what you're editing.  When a form needs to include a textarea
widget, it does a metal:use-macro.

I'm finding parameterising macros a bit tricky.  At the moment I just
add variables to the namespace in the calling template.

Comments?  Is this a common pattern?

seb

In a site which does A library page might consist of a number of form
elements for