Use Case: Change Skin Behavior -
Actor: Site Designer
Goal: Give end users an effective way to navigate the site
You can change not only the look and feel of your CMF site with skins, but also its behavior.
The CMF ships with a number of standard skins and layers. You can build your own skins from scratch or you can customize the default skins.
The easiest way to change the behavior of your site you can customize its skins. See Create new skin for the site for more details on customizing skins. To recap:
- Skins are defined by a collection of Layers
- Layers are collections of presentation and behavior objects.
- Layers are ordered: objects defined in earlier layers override objects defined in later layers.
- You can customize a skin by defining a new layer early in the layer ordering which overrides objects in later layers.
- Zope helps you do this by providing facilities to create customizable copies of objects defined in other layers in the Custom layer.
The layers that come with the CMF define different types of objects.
- Images
- Site images.
- content
- Views, editing forms, and icons for default content types.
- control
- Scripts to control site and content behavior.
- custom
- An empty layer for customization.
- generic
- Default site presentation and behavior.
- no_css
- An example customization layer.
- nouvelle
- An example customization layer.
- topic
- Presentation and behavior for Topic objects.
- zpt_topic
- Presentation for Topic objects using Page Templates. This layer is a work in progress, which no skins currently use.
For customizing skin behavior you will want to focus on the content, control, and generic layers. Changing skin behavior is difficult since most of the objects available to you interact with other parts of the CMF which aren't available to customization. In short, it's difficult to affect complex customization of behavior since that requires an in depth knowledge of CMF internals. Nevertheless you can perform simple customization of behavior.
Here are some of the more interesting objects from those layers that you may wish to customize:
- control/change_password
- This script processes a password change request. You could use it to implement a custom password validity rule.
- content/document_edit
- This script processes a document edit request. You could customize it to filter document contents. For example, it could spell check a document, perform automatic hyper linking of know terms, etc.
- content/file_edit
- This script processes a file edit request. You could customize it to filter or reject certain files. For example, you could reject files larger than a megabyte.
- content/metadata_edit
- This script processes a metadata change request. You could customize it to provide new defaults for unspecified metadata. You could also reject metadata that wasn't valid (for example you could implement a controlled vocabulary).
To customize any of these objects:
- Visit the object in its layer.
- Click the Customize button.
- You'll be taken to a copy of the object located in the
Custom
layer. - Edit the copy of the object.
If you decide that you don't like your customization, simply remove
the custom object from the Custom
layer.