Personal tools
You are here: Home Documentation Tutorials Customizing the viewlets in main_template
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

Customizing the viewlets in main_template

This Tutorial applies to: Plone 3.0.x
This Tutorial is intended for: Integrators, Customizers, Developers, Advanced Developers

Since Plone 3.0, main_template.pt calls viewlet managers instead of METAL macros. Learn from this tutorial how viewlets can be programmatically reordered, hidden or added (from a product on the filesystem).

davconvent

All content on one page (useful for printing, presentation mode etc.)

  1. Introduction What this tutorial is about
  2. Viewlet registration in Plone 3.0 How viewlets are registered in a default Plone installation.
  3. Reordering and Hiding viewlets How to simply change the viewlets behavior from a Generic Setup Profile.
  4. Adding a viewlet How to add a viewlet and still have several skins living in peace.
  5. Overriding a template viewlet How to use Zope 3 technology to override a viewlet with template definition.
  6. Overriding a class viewlet How to use Zope 3 technology to override a viewlet with class definition.
  7. Moving a viewlet from a viewlet manager to another one The title says it all…
 
by David Convent last modified March 18, 2008 - 08:27 All content is copyright Plone Foundation and the individual contributors.

Advantages

Posted by Marco Souza at September 19, 2007 - 00:11
Why do not touch on the main_template is better?

I think the old method sufficiently flexible..

Does viewlets require Zope's restart?

Disadvantages

Posted by optilude at September 30, 2007 - 01:15
You can of course customise main_template still, but when you do so you're on your own. You are more likely to have difficulties upgrading to newer versions of Plone, and you may find that some third party products or parts of Plone don't work as intended if you're not careful in preserving the relevant macros/slots/CSS classes/ids. Viewlets give you a more formal, controllable way of modifying UI elements. Of course, it's sometimes necessary to customise main_template as well.

You don't need to restart to make changes in page templates, but you do need to restart when you change Python or ZCML.

Uninstall

Posted by Christoph Handel at March 10, 2008 - 19:07
I created a blank basic skin using the generator of DIYPloneStyle version 3.0 and including the viewlet example. Installing this example will add a viewlet to the portal footer ("Yay! Wh00t!"). But uninstalling the skin will leave the viewlet there...

here is chinese edition of the tutorials ...

Posted by adam tang at April 23, 2008 - 14:42
深入定制Plone3: http://315ok.org/boke/shenruzope3dingzhi

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by