[Zope-CMF] Lost in SkinSpace!

Tres Seaver tseaver@zope.com
01 Jul 2002 09:24:09 -0400


On Mon, 2002-07-01 at 06:27, Jon Edwards wrote:
> Thanks Kevin,
> 
> That got me digging round and pondering a bit more! Two thoughts -
> 
> 1. What would you call this DTML-method, and how would you make sure it is
> always called (even if they go direct to the 'index_html' - eg. when they've
> bookmarked it)?
> 
> Showing my ignorance of hotfixing/subclassing now, but if you called it
> "setupCurrentSkin" (and probably made it a PythonScript for speed?), would
> it get called instead of the function of the same name in Skinnable.py?
> You'd then need to make sure the line "dtml-call setupCurrentSkin" went to
> the right place, so could you do "dtml-call Skinnable.setupCurrentSkin", to
> stop it calling itself recursively?
> 
> 2. I'm going to be doing it this way throughout all my sites, so long-term I
> think it will be slightly faster if I hotfix/subclass the source-code?
> 
> After further code-diving, I wonder if I'd be better to hotfix/sub-class
> Skinnable.py, rather than SkinsContainer? One way might be to change the
> "getSkinsFolderName" function (which is currently not implemented) to do -
> 
>     def getSkinsFolderName(self):
>         # Returns local skin choice.
>         sk_choice = context.skin_choice
>         return sk_choice
> 
> Hoping Tres, Seb, or another guru will tell me if that's a good place to do
> it! :-)

You could use an AccessRule on each subfolder which just did the
'REQUEST.set' as the folder was traversed;  much nicer than subclassing,
IMNSHO :)

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