Why do we even have these registries?
The ResourceRegistries spring out of ( as most features in Plone ) frustrations with the state of the world before their existence: If you wanted to add a CSS style sheet or a Javascript library to your Plone site, beyond using the ploneCustom.css-file, you would have to override the header templates. This was painful from a maintenance point of view, and it also didn't allow it happening more than once. There was no way of Products supplying their own css files without massive conflicts if more than one Product attempted the same. Having several style sheets and Javascript files to make things more manageable on the filesystem was painful too.
With the existence of ResourceRegistries we were also able to split up Plone's CSS and Javascript into more manageable parts that can be turned on or off at the click of a button. We couldn't do this in earlier versions of Plone as splitting the style sheets would increase the number of separate http-requests needed to display a page incredibly.
The resource registries should:
- Make it easier to work with and supply your own Cascading Style Sheets and Javascripts in Plone
- Make it possible/easier to add conditions to your Cascading Style Sheets and Javascripts so they only apply when you want them to
- Make it easy for Product authors to supply Cascading Style Sheets and Javascripts for their products without getting conflicts with other products
- Reduce the number of http-requests needed to display a Plone page in a browser
- Pack Cascading Style Sheets and Javascripts to reduce the download sizes of files to users, and the bandwidth usage from serving a Plone site
- Make it easy to change priorities amongst Cascading Style Sheets and Javascripts
- Make it easy to disable all or parts of Plone's default Cascading Style Sheets and Javascripts
What are the registries?
The Resource Registries currently consist of two Plone tools living in the ZMI in the root of your Plone site. They have been part of the Plone bundle/installers since Plone 2.1.
They can be used with Plone 2.0.x as well. There is a special readme-file in the product for installation instructions for Plone 2.0.x
How do the registries work?
Each registry has an ordered list of resources, CSS or Javascript files, each with its own set of attributes. Entries in the registries will be linked automatically in Plone pages in the standard templates when the browser requests a page. The registries have been configured to have very sensible defaults — so for almost all use-cases (probably 90%+) it is merely the matter of adding the id of a resource you want to use.
NOTE: For experimentation, for example when reading this document, make sure to check the "debug/development mode" checkbox on the top of the configuration panel. ( read more about why in part 4 )