collective.portlet.collectionmultiview (1.1.2)
by
Olha Pelishok
—
last modified
2011-06-14
Released on 2011-07-06 by Izhar Firdaus for Plone 4.0 under LGPL - GNU Lesser General Public License available for All platforms.
Software development stage: stable
- collective.portlet.collectionmultiview download link: http://plone.org/products/collective.portlet.collectionmultiview/releases
- Homepage of collective.portlet.collectionmultiview: http://plone.org/products/collective.portlet.collectionmultiview
- collective.portlet.collectionmultiview repository: https://svn.plone.org/svn/collective/collective.portlet.collectionmultiview/
- Description source: https://svn.plone.org/svn/collective/collective.portlet.collectionmultiview/trunk/README.txt
A collection portlet product which supports multiple views
The collectionmultiview portlet is a collection portlet which supports multiple view modes. It inherits the built-in plone.portlet.collection and extend it with view adapters support.
Writing additional views
Creating an additional view is as simple as writing a class which inherits from CollectionMultiViewBaseRenderer, and register it as a named adapter
Sample code:
from collective.portlet.collectionmultiview.renderers.base import (
CollectionMultiViewBaseRenderer)
from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
class MyCustomRenderer(CollectionMultiViewBaseRenderer):
__name__ = 'My Custom Renderer'
template = ViewPageTemplateFile('path/to/template.pt')
ZCML:
<configure
xmlns="http://namespaces.zope.org/zope">
<adapter name="mycustomrenderer"
factory=".package.MyCustomRenderer"/>
</configure>