[Zope-CMF] Skin paths

Tres Seaver tseaver@palladion.com
Thu, 20 Sep 2001 20:56:18 -0400


Joćo Neves wrote:

> I'm trying to have one "default" skin (called index_html) for my portal
> root, and another one for different folders.
> My first idea was to have one index_html in the "generic" skin folder,
> and another index_html in my portal root, but the version in the root is
> the only one that ever gets called. Is there any way I can search for
> the index_html file first in the portal_skins, then in the current
> folder, or something like that?


Because skin methods are found by name lookup, and therefore by

acquisition, it is not possible to manage exactly what you are asking
for;  the version of 'index_html' in the root will always "shadow"
the skinned versoin.

On the dogbowl, I worked around this by having 'index_html' only

in the skin:  the method is constructed to look for a (non-acquired)
'local_html', and display it if found;  otherwise, it renders the
default view.

Here is the relevant snippet from 'index_html':

   <dtml-if "localattr( 'local_html' )">
   <!-- localattr -->
   <dtml-var local_html>
   <dtml-else>
   <!-- default view-->
   ...
   </dtml-if>

and here is the text of the 'localattr' External Method:

   def localattr( self, name ):
       """
           Does self have 'name' w/o acquisition?
       """
       return hasattr( self.aq_base, name )



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