[Zope-CMF] Re: Directory-based skin layers?

Tres Seaver tseaver at zope.com
Thu Apr 15 01:13:08 EDT 2004


Ricardo Newbery wrote:
> 
> Hi all,
> 
> I'm returning to experimenting with CMF after a bit of detour and am 
> trying to catch up with all the changes.
> 
> Something occurred to me that would be very useful for a site I would 
> like to convert but the idea seems so obvious that I figured, before I 
> started burning brain cells on it, I would ask this group for some 
> feedback in case someone else has already done it (and wouldn't mind 
> sharing), or in case it shouldn't be done for some reason.
> 
> This idea is this.  I would like to enable directory-based skin layers 
> which would take higher precedence than the layers defined in 
> portal_skins.  I figure it would probably take some hacking of the 
> skinning machinery.  I'm not talking about an access rule that would 
> reset the skin name but rather a mechanism that would acquire any skin 
> layer folders in the current directory and its parents and prepend them 
> to the portal_skin layer list.
> 
> I haven't researched this yet but I'm guessing that CMF makes a 
> dictionary from the portal_skin layers in order to overwrite references 
> to "lower" layer objects with references to "higher" layer objects with 
> the same id.  I figure it should be possible to hack it so that it can 
> do the same with the directory-based layers.

The "normal" process is a search path;  the skins tool looks through the 
layers in order for a given name.  There is no machanism which computes 
a fully populated / "flattened" namespace, although a number of 
proposals have kicked around for caching the results of such searching.

> So why not use an access rule?  Well, the site has lots of directory 
> specific elements that vary throughout the site.  Creating that many 
> different skin permutations seems like a silly way to go (but I'm open 
> to other arguments).  Also, many of these directory specific elements 
> have to be easily editable TTW using CMF's workflow controls -- not 
> something that I see as easy to do with the current skin setup (but 
> again, I'm open to other views on this).
> 
> So what's the verdict?  Is this possible?  Has someone already done 
> this?  Would this be a "bad" thing?  Any suggestions?




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




More information about the Zope-CMF mailing list