[z3-five] Question about skins usage

Philipp von Weitershausen philipp at weitershausen.de
Tue Jul 25 15:23:09 CEST 2006


Maciej Wiśniowski wrote:
> 
>> Will they get different domains? Then you can use rewrite rules:
>>
>>  www.car-shop.com  ->  http://localhost:8080/++skin++CarShop/carshop
>>  www.usedcars.com  ->  http://localhost:8080/++skin++UsedCars/usedcars
>>
>> If they are part of the same domain, use traversal hooks as described
>> above (www.car-shop.com vs. www.car-shop.com/usecars).
>>  
>>
> We have many environments for our applications (developement, testing,
> learning etc.)
> so I think traversal hooks are better choice. I've never played with
> them but
> seems that I have to add  something like:
> 
> def __before_publishing_traverse__(self, object, REQUEST):
>    """ Pre-traversal hook.
>    """
>    # check if there is no skin already and
>    # add/modify a skin to REQUEST['TraversalRequestNameStack'] or
> REQUEST.path

Shrug! Don't mess with the traversal name stack. Simply use
IMySkin.providedBy(request) for checking whether the request has your
skin and zope.app.publisher.browser.applySkin(request, IMySkin) for
applying the skin to the request.

Remember: Skins are just interfaces (that provide ISkin).

Philipp



More information about the z3-five mailing list