Customizing a Rhaptos Site
Plone is very easy to extend and customize. Plone renders pages by using a layered skinning mechanism. You specify a list of directories that contain skin files and when Plone needs to render a page, it starts at the top of the list and searches through each directory until it finds the file it needs. It then uses this file to render the page. Thus, overriding a style that comes with Plone (or Rhaptos) can be done by either modifying the original file, or by placing a file of the same name higher on the skins list.
Several ways to customize a Rhaptos/Plone Site
Depending on the level of customization that you want to do for a Plone site, there are several different options you might want:
- Make a couple minor changes or change the way a couple html elements display
To make a couple small changes to the way a Rhaptos Site looks, all you need to do is edit the files in the appropriate skins directory. An easy way to change the way pages look is to add the file ploneCustom.css.dtml to RhaptosSite/skins/rhaptos_overrides. The new file will override ploneCustom.css.dtml (which should be empty, but will override any default Plone css files). You can easily change the way lists display, the color of text, etc. just by editing this file. Note that ploneCustom.css.dtml is a CSS file that can also contain DTML tags for defining variables. It does not need to contain any DTML if you only know how to use CSS.
Another file that may be useful to edit or override is main_template.pt. This is the file that defines the basic layout of a page in Plone. A custom Rhaptos version can be found in RhaptosSite/skins/rhaptos_overrides. A few simple edits of this file can change the location of different slots on the page. Note that main_template.pt uses the Zope Page Templates (ZPT) markup language, which uses the Template Attribute Language (TAL), Macro Expansion Template Attribute Language (METAL), which both use a syntax called Template Attribute Language Expression Syntax (TALES). Minor modifications could be made to this file without much knowledge of of TAL, METAL, etc. For making major modifications to main_template.pt (or any other ZPT file), I would suggest learning a bit about TAL and METAL first.
- Make major changes to the display of the site
If you are going to make more than a couple changes to the appearance of the site, I would recommend making a new Zope Product. This needs to have its own folder inside of the Products directory of your Zope instance. It needs a couple files to make Zope know about it, like an __init__.py file in the root of the product. Mainly, though, you should make a folder titled skins and then a subfolder in that to hold all the files you will override. For example, if I want to make a cusom Product named MyCustomSkins, the conventional way to organize the product is:
- Products/MyCustomSkins will hold and python files that define unique objects
- Products/MyCustomSkins/Extensions will hold the install script for the product
- Products/MyCustomSkins/skins/my_custom_skins will hold any new, unique skinning files that you create
- Products/MyCustomSkins/skins/my_custom_skins_overrides will hold any files that you are overriding from another Product, like RhaptosSite.
You should place any customizations the Rhaptos and Plone files in this Product. Then, inside the Zope management interface, you install the product and go into the portal_skins object inside of Plone. Inside the portal_skins object, you need to add subobjects for every skins directory you want Plone to know about. These subobjects need to be FilesystemDirectoryView objects. Then, on the properties tab of the portal_skins object you can specify the seach order of the different skins folders. By doing this, you can make sure that all of your files override any Plone or Rhaptos files.
You can then change any skins files you want and place them in your custom skins folder. You can override and page template or CSS file from this folder, and thus change the way any specific page or element looks when rendered. You can also use this to change how forms behave, but that is a little more complex and requires more knowledge of the Plone Form Controller.
Creating your own product is the cleanest way to do customizations and allows you to keep all of your custom files together under one place. This helps if you want to keep the product under version control, etc. Note that Connexions uses a product called CNXPloneSite to make all the style customizations for cnx.rice.edu.
- Add new features and pages
To add new features to a Rhaptos/Plone Site, you definitely want to create a new product as outlined above. You'll need to write python files for any new objects. You'll need to write new page templates for all the new pages, etc. This can be a fairly major project and isn't going to be covered by this blog entry...

<blockquote>Not that ploneCustom.css.dtml is a CSS file that can also contain DTML tags for defining variables.</blockquote>
"Not" should of course be "Note", right?