[Zope-CMF] Disable default Mcros Expand in ZPT...
Grégoire Weber
gregoire.weber@switzerland.org
Mon, 21 Jan 2002 20:46:09 +0100
First of all I have to mention that ZPT are the greatest things
since inventing Zope! No more ugly DTML code anymore! Yessss!
Proposition
-----------
I thought about the 'Expand Macros' topic also and I would prefer a
solution like the following:
1. Solve the problem that expanding can not be undone automatically
a) I would prefer a knob where i can strip away unnecessary code
in a macro (the same that gets striped upon merging the
define templates and use templates code for presentation).
b) I think ZPT should have three versions of presentations:
- expanded version
- striped to the minimum version
- the 'original version'
I have to explain 'original version' ba a use case:
As I design templates through the web I like to have a
version with a simple design (self made, not automatically)
containing comments etc. to make it easy for me to orientate
in the code. I usually want to have that code in the portion
that gets striped away upon rendering.
Knowing anything about the internal design of the page template
implementation the proposed design has to save the 'striped to
the minimum version' and a diff between the 'striped to the
minimum version' and the 'original version' to not loose the
code between the use-macro tag and the fill-slots tags.
2. Solve the problem of code representation in different kind of
access modes (ZMI, ftp, webdav, ...)
It should be possible to define the above version exposed to the
user dependant on how he access the template code. In my situation
I would configure it the way that the 'expanded version' gets
exposed through ft and webdav and the 'original version' through
the ZMI.
There would be a need of a default definition in case you add
an additional possibility (protocol) to access the code.
This could be controled by properties in the object tree of the
ZODB.
I hope my explanations would be clear enough to be understood.
It would be easy to express that in german, but english ...
For answers from teh ZPT-List
Please include my address because I'm not subscribed to this list.
Greg
> Tres wrote on Mon, 21 Jan 2002 10:54:18 -0500
>
> ycheng wrote:
>
> > [...]
> > So, will it be better not to expand the macros in the default behavior..
>
> I agree that this is an annoying issue for those of us who
> deal with the ZPT as source; unfortunately, ZPT is designed
> for people who use it as WYSIAYG, too, and macro expansion is
> essential for them.
>
> We might be able to set this up as a preference on the
> skins tool, which the FSPageTemplates would check when they
> create the customized copy. This tweak would solve the problem
> of the *initial* expansion, but would still not help when
> *both* the programmer *and* the designer need to work with the
> same customized template. Perhaps page templates need an
> "unexpand" method? (Hmm, that would depend a lot on the
> macro used to expand the template; I don't know if a good
> general solution exists).
>
> I am CC'ing the ZPT list in case somebody there has more zen
> about the idea of unexpanding.
>
> Tres.
_____________________________________
Grégoire Weber
mailto:gregoire.weber@switzerland.org