Overriding a Portlet¶
A quick cheat sheet of how to override or customize a portlet.
Through the Web¶
- Use Site Setup > Zope Management Interfaces > portal_view_customizations to customize the template of an existing Plone Default portlet.
In your own product¶
There is a detailed tutorial available here:
You can also look up the details of the portlet you want to override in the Elements section of this manual.
Quick Cheat Sheet¶
You will need to know the name of
- Your theme-specific interface
- This is optional but ensures that your portlet is only available for your theme. If you used the plone3_theme paster template, then the name will probably be IThemeSpecific.
You will need to create the following (you should be able to locate the originals to copy by looking them up in the Elements section):
- plone portlet renderer directive
- [your theme package]/browser/configure.zcml
- page template
- [your theme package]/browser/[your template name].pt
- Python class *
- [your theme package]/browser/[your module name].py
* in most cases you won't need a Python class
Sample configuration.zcml directive¶
<configure
xmlns:plone="http://namespaces.plone.org/plone">
<include package="plone.app.portlets" />
<plone:portletRenderer
portlet="[element interface]"
template="[your template name].pt"
(or class=".[your module].[your class name]")
layer="[your theme specific interface]"
/>
</configure>