Skip to content. | Skip to navigation

Sections
Personal tools
You are here: Home News & views Easier theming with Content Well Portlets

Posted Dec 17, 2008

Easier theming with Content Well Portlets

by Catherine Williams

The ContentWellPortlets product lets you put portlets into the main section of your page, above and/or below your content. This provides a handy way of creating distinctive page layouts without having to write new page templates.

Easier theming with Content Well Portlets

An example of ContentWellPortlets being used to pull a series of collection portlets into a site's home page.

WebLion products aim to make theming easier

Over the past few years, WebLion has been trying to take some of the pain out of theming Plone sites with products such as:

  • CSS Manager, which lets you change colors, fonts, borders and the site logo without touching any code or the ZMI
  • EasyAsPiIE, which eliminates the problems that arise from viewing transparent PNG images in Internet Explorer 6
  • Gloworm, which enables you to delve into, and customize, the viewlets of your Plone 3.1.6+ site
  • CustomNav, which gives you the capability to have different kinds of navigation tree in different parts of your site (very useful in Plone 2.x; can still come in handy for some Plone 3 use cases)
  • Entire themes, such as plonetheme.nautica05

Our latest addition to this stable is ContentWellPortlets, a product born out of a need to satisfy recurring demands from clients.

Wanted: portlets "in the center column"

PSU College of CommunicationsMany of our clients want to have home pages, and/or main section pages, that use portlets all over the place, not just in the left and right columns.

In the olden' days of Plone 2.5, we used to help them write page templates that pulled portlets into the correct places. These templates could be facultatively applied at appropriate points in a site.

Plone 3's viewlets (bless 'em) and 3-column table-based layouts have changed things somewhat.

Instead of writing whole page templates, we have found ourselves adding portlet managers into new viewlets we put into clients' theme products.

This enables some interesting layouts without having to touch a page template. It also means that similar layouts can be applied to different content types (pages and folders, for example), without having to change templates for each of these.

Example 1

For instance, the Penn State College of Communications home page (pictured right) uses two portlet managers in the center well:

  • the right-hand one pulls in a portlet that rotates a series of images
  • the left-hand one pulls in an RSS portlet (top) and a collection portlet (bottom).

Example 2

Portlets in the footer as pseudonavigationOn Penn State's Teaching and Learning with Technology website we use collection portlets as "psuedonavigation", to highlight items under a variety of headings.

The site contains 5 sets of collection portlets across the base of each page, above the footer (pictured, left).

Now: a product that does it for you

Given the demand from our clients for portlets in the middle of page layouts, we decided to write a standalone product that could be installed in conjunction with any of their themes. This saves us having to modify theme after theme, one by one.

The result is Products.ContentWellPortlets. As the name suggests, it allows you to add content-well portlets, that is, portlets in the central column (the table cell with the "portal-column-content" CSS id). Specifically, you can add:

  • Up to 3 columns of portlets above the page title
  • Up to 3 columns of portlets below the page contents, above the footer

Content-well portlets can be added pretty much anywhere on your plone site: on the home page, folders, pages... As with portlets in right and left columns, content-well portlets set on a parent item are inherited by children and grandchildren (etc) unless blocked.

Who can add content-well portlets?

Anyone with the "Portlets: Manage portlets" permission. Typically, this will be someone with the Manager role, but you may have given that permission to another role on your site.

Does much of the work for you, but you may still need to customize your....

...CSS

If you use ContentWellPortlets, you will probably need to write some CSS to style the portlets to match whatever layout you want (one column, two column, three column?). As with other portlets, you may also want to use CSS to style the headers, portlet items, item separators and so on.

With both the above examples, much of the "look and feel" comes from styling with CSS. This is something that our clients are typically very comfortable with: no steep learning curves in this part of the theming process.

...Portlet templates

Depending on what kind of portlet you want to display, you may need to customize the template for the portlet concerned. For example, in the College of Communications theme, we customized the collection portlet template to pull in images where relevant.

However, you may already be customizing these templates for use elsewhere in your site. For example, the Penn State Department of Meteorology's Plone site (in development) wants to display news and events portlets centrally on the home page, but in the right-hand column on some other pages. Customizations to news and event portlet templates apply to portlets throughout the site, regardless of where they are pulled in: our client only needs to do one set of customizations.

Feedback, please!

Please let us know how you are using this product! As ever, bugs and feature requests are welcome.

Stop-press (Dec 17): The technical glitch with the egg should now be sorted. (Thanks ErikRose, RobZoneNet and pumazi for helping hunt down the changes needed to our ReleaseYourProduct wiki page!)

Document Actions

New egg and tarball: 1.0.1 egg and tarball work

Posted by Catherine Williams at Dec 17, 2008 04:07 PM
If you are using the product egg or tarball rather than checking the product out of our subversion repository, make sure you use the 1.0.1 version rather than the 1.0 version (we had a glitch with the 1.0 versions of egg and tarball).

New version released: 1.1

Posted by Catherine Williams at Dec 19, 2008 09:18 PM
We've released a new version of this product.

The 1.1 version has different behind-the-scenes machinery for rendering the portlet managers.

Any portlets you added using the 1.0 or 1.0.1 versions should still be visible, editable and manipulable if you update to the 1.1 version of this product.
Need help now?

Immediate assistance is available during university work hours:

News & views…
Posted Oct 13, 2009 Portlets gone wild with ContentWellPortlets 2.0.1 This new release adds the ability to add portlets to the footer area. It also has 6 portlet managers per area. This means 20 total portlet managers including the 2 on the sides that ship with plone.
Posted Sep 17, 2009 Plone 4 – An interview with Zope News Jan Ulrich Hasecke interviews me for Zope News.
Posted Aug 31, 2009 Web Services API for Plone Alpha 3 Release Details the release of the wsapi4plone.core package and the plans for future releases. The final report of the AtomPub for Plone Google Summer of Code project.
Posted Aug 28, 2009 Content editing and creation in Plone is faster with archetypes.schematuning Some bench marks of content editing and creation in Plone with and without archetypes.schematuning installed.
More news & views…