[CPS-devel] CPS renders itself recursively after customizing main_template.

Jean-Marc Orliaguet jmo at ita.chalmers.se
Tue Apr 11 09:37:00 CEST 2006


JoseLuis de la Rosa Triviño wrote:

>Hello, 
>
>What I wanted to do is to add an "id" attribute to the html "body" tag. I did it by modifiying directly from file system level and it works fine.
>
>I have tried to find the way the renderer switches between the two main_template.pt, but I can't see it clearly. May you give some tips about how that procedure works?
>
>Thank you very much.
>
>  
>


Hi, there are 2 main_template.pt files, one in skins/cpsskins_cps3 and 
another in skins/cpsskins_cps3_macroless. You can modify them (at your 
own risk) but not customize them.

The switch occurs in MainContent.py and in the Main content portlet:

    security.declarePublic('render')
    def render(self, template=None, options=None, **kw):
        """Render the main content area by switching to a 'macroless' skin
        inside the request.
        """
        rendered = ''
        if template is None:
            return self.cpsskins_maincontent()
        portal = getToolByName(self, 'portal_url').getPortalObject()
        portal.changeSkin('CPSSkins-macroless')
        rendered = template.pt_render(extra_context={'options':options 
or {}})
        portal.changeSkin('CPSSkins')
        return rendered


/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.