Attention

This document was written for an old version of Plone, Plone 3, and was last updated 930 days ago.

To learn how to upgrade to the current version of Plone, read the upgrade manual.

Put static HTML/CSS into the theme package

by Denys Mishunov last modified Nov 04, 2009 07:55 AM
How to add your static resources to the Plone theme

After you have a theme’s skeleton you start putting your static resources into it. There are at least 3 options you have for doing this:

  • Add your resources to customs/ folder of your Plone site. Fast, doesn't require Plone theme generation at all. But is very dirty workaround that is not recommended;
  • add your resources as browser resources to the browser/ folder. An advanced method but produces ugly URLs for your resources.
  • add your resources to the skins/ folder of generated theme package. Easy, fast, usually less registration involved compared to the browser/ folder way.

You are free to chose any way you want to add your static resources to your plone site. But in this tutorial we will follow the third option - with skins/ folder as the easiest one since we already have a pre-generated structure within skins/. If you do so, most probably you need to change paths to your resources like images in your style sheets.

Some notes

  • You might want to add a new folder in skins/ for your JavaScripts for example. ZopeSkel doesn’t generate a JavaScripts folder for you. If you are adding such new folder within skins/ add a registration for that folder in skins.zcml and profiles/default/skins.xml
  • If you want to keep the folders’ names as they are in your static theme (like images/ or styles/ etc.) don’t forget to edit profiles/default/skins.xml.
  • If you add any CSS or JS resource don't forget to register it in profiles/default/cssregistry.xml or profiles/default/jsregistry.xml respectively in order to put your resource under the portal_stylesheets and portal_javascripts tools management.

Restart your instance and re-install the theme to make all your recent changes take effect. Once you've made sure your theme is installed and all your resources are available and registered you can start writing the transformation rules.


Contribute

Something wrong or out of date? Anybody can edit or create a new article in the knowledge base. Simply create an account on this site, log in, and click the Edit button to contribute.