Using viewlets (and views) in third-party products

Martin Aspeli optilude at gmx.net
Fri Aug 31 07:44:03 UTC 2007


Alex Clark wrote:
> On 2007-08-26, Martin Aspeli <optilude at gmx.net> wrote:
>> The problem is that if we have a third party product that wants to 
>> install, say, a tagging viewlet, but only have this show up on sites 
>> where it's actually installed, then that product can't define a brand 
>> new theme (since only one theme is active at a time). It *could* of 
>> course render the viewlet conditionally (if I'm not installed, render 
>> the viewlet as a blank), but that'd be cumbersome and silly.
> 
> So basically, if I install a theme package in site foo, bar will get
> foo's viewlets (where foo and bar are in the same zope instance) ? 
> If not, then I don't understand :-p

No. For *themes* it's fine, since we can tie viewlets in the theme to a 
particular Zope 3 layer ('layer' attribute of browser:viewlet in ZCML).

The problem is that third party non-theme products can't do this, since 
the way plone.theme works, only one theme is active at a time.

Therefore, we need something more general that can work out which layers 
are "active" and which are not - similar to have the portal_skins tool 
manages the "skin layers" installed in a theme.

Martin


-- 
Acquisition is a jealous mistress





More information about the Product-Developers mailing list