Skip to content

Bika Lab Systems

Sections
Personal tools
You are here: Home Help Centre How-tos Simple portlet munging
Document Actions

Simple portlet munging

This How-to applies to: Any version.

Very quick and simple portlet management in Plone 2.5.

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

};-)

Posted by Campbell at 2009-04-23 21:19
it's all hacky, and plone 3 is better at this
anyway back to search for not-cached password
 

www.bikalabs.com - Home of Bika Lab Systems, implementers of web based open source LIMS, Plone hosting and content management systems   Powered by Plone, the open source content management system. Customised and maintained by Bika Lab Systems