Configuration
Plone Theme Reference
1. Profiles
Configuration and profiles
Configuration refers to the default behaviour of a site (for instance, whether you allow people to sign up to your site, or how dates are displayed). You're likely to want some of this behaviour to be embedded in your theme.
There is also some overlap between Components, Skins, and Configuration. For instance, the order of skin layers and the order in which viewlets appear within a viewlet manager are considered aspects of configuration.
Profile
A profile is a set of configuration files. Each file is written in fairly simple XML and refers to a particular group of components or page elements. There are two different types of profile, base profiles and extension profiles. For theme purposes you will only ever need to use an extension profile (i.e., a profile that extends the configuration of an existing site).
A profile comes into being when it is wired up by ZCML. Here's the version created by the plone3_theme paster template:
<genericsetup:registerProfile name="default" title="[your skin name]" directory="profiles/default" description='Extension profile for the "[your skin name]" Plone theme.' provides="Products.GenericSetup.interfaces.EXTENSION" />
You'll see that it points at a directory for the location of the XML files and indicates that it is an extension profile by using an interface.
2. Generic Setup XML
The language used to define profiles.
The XML used for profile files is straightforward. There's no DTD available, but there are plenty of examples to reuse or adapt for your purposes. If all of this seems too much, the good news is that you can get Generic Setup to write the files for you by exporting the configuration from an existing site. There's more information on how to do this on the Generic Setup Tool page.
The root node of an XML profile is usually an object:
<object name="portal_javascripts" meta_type="JavaScripts Registry">
.......
</object>
which corresponds to a particular site tool (in this case the JavaScripts registry). Sub-nodes represent sub-objects and XML attributes correspond to the attributes of those classes.
<javascript cacheable="True" compression="none" cookable="True"
enabled="True" expression="" id="jquery.js" inline="False"/>
So, in this case, the sub-node represents an entry in the JavaScripts registry and its tick boxes.

In the very unlikely event that you need to work out for yourself what attributes to use, you'll need to investigate the API (or the interfaces and classes) of the tool in question. Use http://api.plone.org or dig into the source code.
3. The Generic Setup Tool
The Generic Setup tool is used to apply your profiles to your site.
You can find the Generic Setup tool here
- Site Setup > Zope Management Interface > portal_setup
You can run the tool manually, but for theme purposes, if you have created a product using the plone3_theme paster template, Generic Setup will be triggered automatically when you install your theme in your site.
You'll find more extensive information about the Generic Setup Tool in this tutorial:
However, there are two useful facts to know about it.
No Undo
Although you can uninstall your theme using portal_quickinstaller, at present, you can't undo the profiles Generic Setup applied during installation. For the most part, this isn't a problem, but it can get confusing - if, for instance, you are experimenting with the order of your viewlets and have tried several versions of viewlets.xml in successive installations. In this case, exporting a profile (explained below) can help you make sense of what you've done.
Exporting Profiles
You can export the current configuration of your site as a set of XML files. This can be helpful if you're not quite sure what you've done, if you're searching for a profile to base your own configuration on, or if you just want the Generic Setup Tool to write out a configuration for you.
- Site Setup > Zope Management Interface > portal_setup
- Click the Export tab
- Select the steps you wish to export
- Click the Export Selected Steps button
- You'll be given a zip file with the relevant XML files
It isn't always obvious which export step you need to get the exact configuration you want, you may need to experiment.
4. Where to find what you need
How configuration works through the web and how to track down files on the file system.
Through the Web
There are a number of different routes to configure your site through the web. The Elements section of this manual should give you pointers on where to look to configure particular page elements. In general
- Site Setup leads you to configlets for the site settings
- Site Setup > Zope Management Interface will lead you to the style sheet and JavaScript registry (portal_css and portal_javascripts)
- Adding /@@viewlet_manager to a URL will enable you to order viewlets
Plone Default Configuration on the File System
You will find most of the configuration files you need in:
- [your products location]/CMFPlone/profiles/default
However, be aware that some configuration files may be located in third-party products. For instance, if you want to add some styles to the visual editor, Kupu, as part of your theme, then you will need kupu.xml which you'll find in [your products location]/kupu/plone/profiles/default.
There's an alternative to hunting around the file system, and that's to use the Generic Setup Tool to export the profile.
In your own Theme Product
/profiles/default/- This directory holds the XML for Generic Setup. The plone3_theme paster template will have provided you with some ready-made files - for setting up your skin layers, registering your style sheets and JavaScript, and ordering your viewlets.
- /profiles/default/import_steps.xml
- Is an essential file for installation, you shouldn't need to change this.
- /profiles/default/cssregistry.xml | jssregistry.xml
- will register any style sheets and JavaScript in your skin. You will have to edit these yourself if you have any css or Javascript files to add.
- /profiles/default/skins.xml
- Will drop your skin layers into the right order of precedence. You won't need to change this unless you've renamed, removed, or added directories in the skins directory of your theme egg.
- /profiles/default/viewlets.xml
- will determine in what order viewlets appear in viewlet managers. You will need to edit this yourself if you want to add your own viewlets.
- /profiles.zcml
- When your Zope instance starts up, this file makes the profile available for Generic Setup to use.

Author: