[CPS-devel] Re: CPSSkins skins in extension profiles

Jean-Marc Orliaguet jmo at ita.chalmers.se
Thu Jan 19 18:42:17 CET 2006


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


More information about the cps-devel mailing list
More information about CPS: CPS project - CVS - API

Hosting: Nuxeo: Zope service provider


This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.