Jim Fulton wrote:

>
>>
>> it would not be concerned with index.html / report.html / edit.html
>> AT ALL.
>>
>> you would just place a "Main Content Portlet" in the middle of the page
>> and let the application underneath take care of rendering the poll
>> screens.
>>
>> cf
>> http://svn.nuxeo.org/trac/pub/file/z3lab/cpsskins/trunk/portlets/macroslot/__init__.py
>>
>> the portlet renders the current view that gets inserted it into the
>> theme at the location of the portlet.
>
>
> Let me try to rephrase this: The portlet renders the current view.
> It renders it into the location of the portlet within the theme-defined
> page. :)
>
yes

> Where does it get the current view? Is it normally passed in? By whom?

from the original theme renderer's template.pt (associated to the
cpsskins skin). It gets propagated all the way from the view to the
portlet, through the page, cells, etc. as a keyword parameter that the
renderer can use at any time.

the orginal context is also propagated.

cf. in
http://svn.nuxeo.org/trac/pub/file/z3lab/cpsskins/trunk/browser/skin/template.pt

    <body tal:content="structure python:pageview(
      tmutil=tmutil,
      context_obj=context,
      view=view,
      engine='default')" />


>>
>> yes, inside the theme you leave a "window area" to display views from
>> the application you're designing a theme for. You can use the zwiki
>> application under cpsskins already, although cpsskins knows nothing
>> about wiki pages.
>
>
> OK, I get it. So this this is all about defining what Tres likes to
> call the "O wrap".  The stuff that is drawn around the application
> generated markuo and that, through CSS styles, images, etc, has
> some influence on how the markup is displayed.
>

yes, CPSSkins was created from the beginning as a simple replacement of
main_template before all the theme / page distinctions were introduced.

the breakthrough difference in the zope3 version is that the main
content area (inside the O wrap) can be rendered directly in python.

> So, what if I wanted to use portlets within one of my application
> views?  Does CPSSkins let me do that too?
>
> Jim
>

yes, these would be application-specific portlets, as the ones used in a
calendar application for instance showing a monthly agenda. The portlet
gets access to the current view object, to the current page location
(renamed from 'context_obj' to 'location'). So as soon as you can
produce some data from that you have a portlet that can be put inside a
theme page.

it is not recommended to render portlets directly in HTML though (except
for the main content portlet), since cpsskins takes care of formatting
and displaying the data using widgets.

/JM



_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to