[ZPT] Re: [Zope-CMF] ZPT Problems

Tres Seaver tseaver@zope.com
Sat, 15 Dec 2001 12:50:47 -0500


Joerg Lehmann wrote:

> On 14.12.01, Keller Nicolas wrote:
> 
>>Hi!
>>
>>I'm building a portal with CMF and I've just finished the main layout of the
>>site (in zpt). I've created 4 new skin folders named after the original ones
>>(my_content, my_control,...) and already put my new main_template into it.
>>It works kind of perfect put now there's a strange problem: When I want to
>>customize one of the given templates (like link_view, image_view, etc...)
>>Zope uses the new main_template with it before it copys the file into the
>>my_* - folder. This doesn't make sense to me - in my opinion it's supposed
>>to put the file into the new folder without touching it, otherwise every
>>file is kind of overloaded.
>>
> 
> I assume, you mean it "expands" the METAL-macros. The only possibility for me 
> to get rid of this annoying behaviour was to set expand=0 in the definition of 
> the class PageTemplate (cf. lib/python/Products/PageTemplates/PageTemplate.py). 


This issue is hard to solve in a way that doesn't penalize

one side or the other:

   - People using WYSIWYG tools expect the expansion of METAL
     macros, so that the templates look as they will when used
     "live";

   - People who use the textarea, or a text-based WebDAV/FTP
     editor, typically *don't* want the expansion, which obscures
     the "real" parts of the template.

Perhaps we should patch PageTemplates to use some configurable
switch (an environment variable, or a command-line switch?  A
globally-acquired attribute?) for the default value now stored
in 'PageTemplate.expand'.

Another alternative would be to add a knob to PageTemplate which
strips out everything that supplied by METAL (maybe we spell that
by supplying the path to an "empty" template, an do the expansion
using the empty template, followed by setting 'self.expand=0'?)


Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com