Simple portlet munging
This How-to applies to: Any version.
To display a Zope Page Template in a portlet
This example will convert Page Templates called "portlet" into portlets for their folder.
In the ZMI
Create the portlet (ie portal_skins/custom/portlet_autoportlet) and enter the following text into the file:
<div metal:define-macro="portlet" tal:condition="exists:here/portlet"> <dl class="portlet"> <dt class="portletHeader" tal:content="here/portlet/title">...</dt> <dd class="portletItem" tal:content="structure here/portlet">...</dd> </dl> </div>In the ZMI
Go to the root Plone instance folder and select Properties
Add this line to left_slots or right_slots:
here/portlet_autoportlet/macros/portlet
In the ZMI
Navigate to any Plone folder
Add a page template called "portlet"
Set the title, and put some HTML and tal into it.
To make one simple static portlet
In the ZMI
Create the new portlet (eg portal_skins/custom/portlet_contentsportlet) and put this in it:
<div metal:define-macro="portlet"> <dl class="portlet"> <dt class="portletHeader"> Contents </dt> <dd class="portletItem"> <p tal:repeat="o here/contentItems" tal:content="python:o[0]"/> </dd> <dd class="portletFooter"> Footer </dd> </dl> </div>In the ZMI
navigate to existing plone folder, select Properties, and add this to left_slots or right_slots:
here/portlet_contentsportlet/macros/portlet
left_slots and right_slots are inherited, so you need to copy the set from the bika root folder properties
};-)
anyway back to search for not-cached password