Controlling left - right slots (portlets)
Controlling portlets
To control which slots are displayed and where:
- Click on your Plone
site
- Located: at the root
- Click on the
Properties
tab at the top. You should see:
- Each line in
left_slots
andright_slots
is a portlet - Deleting any line from
left_slots
orright_slots
will remove that portlet - Moving any line from
left_slots
toright_slots
or vice versa will change the side of the page on which the portlet appears - Format: here/portlet_name/macros/portlet
- Remember to click the "Save Changes" button
How do I control the boxes in the left and right columns of Plone?
In the left and right columns of a page, Plone displays different boxes with different content - navigation, login, news, events etc.
But you normally don't want to display all boxes on all pages. So
you have two variables which control box (aka. portlet) displays: left_slots
and right_slots
.
If you enter the Zope Management Console and go to the root of your
Plone site and look in the properties tab, you will see an example of
how it can look, for example the default left_slots
can look like this:
here/portlet_navigation/macros/portlet
here/portlet_login/macros/portlet
here/portlet_about/macros/portlet
here/portlet_related/macros/portlet
This means that the left slot shows the Navigation, Login, About and Related portlets.
So let's say you want to get rid of the login box. Just remove that line from the list, and press Save Changes
. It's that easy.
Great, but I want different behaviour in different folders
Well, that's almost as easy. Let's say you have a folder /download
that you want to remove all the boxes in the right column from.
- Enter the folder inside the Zope Management console
- Go to the
Properties
tab - At the bottom of the form, add a property called
right_slots
of the typelines
, with no content - Press
Add
Now you have an empty box that overrides the default right column boxes in this folder. And also in the contained folders, so download/old-files
will not have the boxes either.
If you have no boxes in a column, Plone will expand to fill the available free space. To add one of the previous boxes to this slot, simply copy one of the path expressions above and paste it into the new right_slots box.
Great, but I only want to apply this to a specific document
To manage the properties on a specific document, you have to add by hand, in the address bar of your browser, /manage_propertiesForm, instead of /manage_metadata. For example for www.plone.org/index_html, you have to put www.plone.org/index_html/manage_propertiesForm. Watch the uppercase in F.
Be aware that the portlets definition would work for that page only; and probably you will have to add the properties left_slots and right_slots, with type lines.
Wonderful, but I want different behaviour for a particular template (valid since Plone 2.0.5)
Again, that's almost as easy. Let's cover the use case present on comments: remove slots from undo_form
.
- Customize the
portal_skins/plone_forms/undo_form
object - Go to the
Properties
tab - At the bottom of the form, add a property called
left_slots
orright_slots
of the typelines
, with no content (or containing only the desired ones) - Press
Add
Now you have a custom box that overrides the default columns boxes only in this particular template.
Closing comments
In general it's useful to remove and customize the slots to specific folders - because it causes less clutter, because it gives you more free space when you need it, and because too many CPU-intensive slots can really slow down your site if you do not cache them (the Calendar slot is a particularly nasty slot :).
The available portlets in Plone are by default located in plone_portlets
. The ones not starting with portlet_
are the old versions, and will disappar after version 2.0.