For a generic plone 3 portlet with a template portlet.pt and a module named portlet.py, this is what you need to do to subclass it. I tend to create a portlets folder in my porducts, which you have to register in the same way as the browser folder from your theme is registered. Don't forget the __init__.py and a configure.zcml!
portlet.pt template from the source
egg into your theme's
portlets/ directory. Don't copy
portlet.py, but instead create
portlet.py. It needs only the following measly five lines of
from source.egg.portlet import Renderer from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile class MyPortletRenderer(Renderer): render = ViewPageTemplateFile('portlet.pt')
portlets/configure.zcml put the following lines:
<plone:portletRenderer portlet="source.egg.portlet.IPortletInterface" layer=".interfaces.IThemeSpecific" />
If, like in this example, the template in the renderer is called render (so render = ViewPageTemplateFile('portlet.pt')) and not index or _template or something the like, you just use the template instead of creating a class for it in a special portlet.py. The subclassing also works with multiple templates or differently named ones.
<plone:portletRenderer portlet="source.egg.portlet.IPortletInterface" template="portlet.pt" layer=".interfaces.IThemeSpecific" />