Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install collective.portlet.collectionmultiview

How to install collective.portlet.collectionmultiview

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install collective.portlet.collectionmultiview
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
2.2 Available View build log
2.0.2 Available View build log
1.1.2 Available View build log
1.1.1 Available View build log
1.1 Available View build log
1.0 Available View build log
0.1dev-r0 Available View build log
Windows (64-bit)
2.2 Available View build log
2.0.2 Available View build log
1.1.2 Available View build log
1.1.1 Available View build log
1.1 Available View build log
1.0 Available View build log
0.1dev-r0 Available View build log
Mac OS X (10.5+)
2.2 Available View build log
2.0.2 Available View build log
1.1.2 Available View build log
1.1.1 Available View build log
1.1 Available View build log
1.0 Available View build log
0.1dev-r0 Available View build log
Linux (32-bit)
2.2 Available View build log
2.0.2 Available View build log
1.1.2 Available View build log
1.1.1 Available View build log
1.1 Available View build log
1.0 Available View build log
0.1dev-r0 Available View build log
Linux (64-bit)
2.2 Available View build log
2.0.2 Available View build log
1.1.2 Available View build log
1.1.1 Available View build log
1.1 Available View build log
1.0 Available View build log
0.1dev-r0 Available View build log
 
Author
License
GPLv2+
Depended by
Lastest release
version 2.2 on May 16th, 2013

Introduction

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 BaseRenderer, and register it as a named adapter

Sample code:

from collective.portlet.collectionmultiview import BaseRenderer
from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile

class MyCustomRenderer(BaseRenderer):
    title = 'My Custom Renderer'
    template = ViewPageTemplateFile('path/to/template.pt')

ZCML:

<configure
   xmlns="http://namespaces.zope.org/zope">

   <adapter name="mycustomrenderer"
       factory=".package.MyCustomRenderer"/>

</configure>

Extending portlet schema

You can also extend the portlet schema with additional fields by setting the 'schema' attribute in the renderer class.

Sample code:

from collective.portlet.collectionmultiview import BaseRenderer
from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile

from zope import schema
from zope.interface import Interface
from plone.app.form.widgets.wysiwygwidget import WYSIWYGWidget

class IExtraFields(Interface):
    my_extra_field = schema.Text(title=u'Extra field')

class MyCustomRenderer(BaseRenderer):
    title = 'My Custom Renderer'

    schema = IExtraFields
    template = ViewPageTemplateFile('path/to/template.pt')


    #optional
    custom_widgets = {
        'my_extra_field': WYSIWYGWidget
    }

Changelog

2.2 (2013-05-15)
  • Plone 4.3 compatibility. PEP 8 cleanup. [thet]
  • Add Plone entry point in setup.py [fredvd]
2.1.5 (2013-01-24)
  • returning None on attribute not found introduced a major bug when editing, fixed it by moving this as an adapter in renderer [kagesenshi]
2.1.4 (2013-01-24)
  • return None if attribute not found on Assignment to avoid crashy behavior when new fields are introduced by schema extender [kagesenshi]
2.1.3 (2013-01-03)
  • 'random' field should be in primary schema rather than on default

    renderer schema [kagesenshi]

2.1.2 (2013-01-02)
  • Add 'available' property to portlet renderer [kagesenshi]
2.1.1 (2012-12-06)
  • Fix unicode decode error for unicode chars in href title for default renderer [kaerumy].

    Supported by: Centre for Internet Society, India

2.1.0 (2012-11-06)
  • Added support for new style collection [kagesenshi]
2.0.2 (2012-03-26)
  • Added way to assign custom widget [kagesenshi]
2.0.1 (2012-03-20)
  • Fixed problem with installation of 2.0 due to missing README.rst [jone]
2.0 (2012-03-20)
  • Added mechanism for additional views to extend the portlet schema [kagesenshi]
  • Massive code cleanups [kagesenshi]
  • CREDIT: changes above funded by cis-india.org
1.1.2 (2011-06-06)
  • Plone 4.1 compat [aclark]
1.1.1 (2011-03-31)
  • bugfix release. fixed a bug with the renderer selector using title as value

    instead of id

1.1 (2011-03-27)
  • Plone4 compatibility
  • Renderers now may have a human readable __name__
  • Removed GalleryRenderer as it is broken anyway
  • Hide unnecessary fields from the base Plone collection portlet.
1.0 (2010-12-19)
  • fix permission used for portlet [vangheem]
0.1 (2009-12-31)
  • Initial release

Subscribe to package updates

Last updated May 16th, 2013

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.