Florent Guillaume wrote:
>
> On 18 Jan 2006, at 21:50, Jean-Marc Orliaguet wrote:
>
>>
>> Yes, both are needed (CPSSkins and CPSSkins-macroless), because the
>> macroless skin is used by the main content templet to render the
>> content of the main ZPT macro slot using python code.
>>
>> the skins overrides the default 'main_template.pt' with:
>>
>> <metal:block define-slot="main" />
>
>
> Hm and it does only that... It would be nice if we could find a hack
> that avoided having an entire skin to maintain just because we have
> to switch to that main template from time to time.
>
> Florent
>
In zope3 the same technique is implemented in a much simpler way.
Probably because named adapters / pages are used for looking up the
skins, there is no need to duplicate all the information between the
layers as in CMF:
configure.zcml:
<browser:skin
name="cpsskins-macroless"
interface=".portlet.IMacrolessSkin"
/>
<browser:page
for="*"
name="standard_macros"
permission="zope.View"
class="cpsskins.browser.skin.standardmacros.StandardMacros"
allowed_interface="zope.interface.common.mapping.IItemMapping"
layer="cpsskins-macroless"
/>
<browser:page
for="*"
name="skin_macros"
permission="zope.View"
layer="cpsskins-macroless"
template="macroless.pt"
/>
portlet.py:
...
# Switch to the macroless skin before rendering the view
applySkin(request, IMacrolessSkin)
# Render the view
markup = template(instance=view)
/JM
Hosting: Nuxeo: Zope service provider