[Zope-CMF] Directory-based skin layers?

Ricardo Newbery newbery at dvgroup.com
Wed Apr 14 16:46:59 EDT 2004

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.

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?

Ricardo Newbery

More information about the Zope-CMF mailing list