Create the Theme
PLONE SYMPOSIUM EAST 2011
$ paster create -t plone3_theme
From the command line, use paster in
builtout/src to create the theme.
This template does work for Plone 4, specify
‘Sunburst Theme’ as the skinbase.
Install the Theme
PLONE SYMPOSIUM EAST 2011
Add your new theme to buildout.cfg in the
[buildout] section under eggs, zcml, and develop.
Run buildout, start instance, and install theme in
ZMI > portal_quickinstaller.
Change the Logo
PLONE SYMPOSIUM EAST 2011
The name of the logo image to be used can be
found and changed in
skins/styles/base_properties.props
Put your new logo in skins/images/ and make
sure the filename matches what is in
base_properties.
Apply Styles
PLONE SYMPOSIUM EAST 2011
Put a file into your theme/skins/styles folder
called ploneCustom.css
Create new CSS files by adding them to the CSS
registry.
cssregistry.xml - Generic Setup - portal_css
Generic Setup
PLONE SYMPOSIUM EAST 2011
Generic Setup is the connection between
content/changes in your site and the filesystem.
ZMI > portal_setup > Import/Export tab
theme/profiles/default/
Find Original Templates
PLONE SYMPOSIUM EAST 2011
Using omelette, you can find the templates you
want to override.
Viewlets: plone/app/layout/viewlets
Portlets: plone/app/portlets/portlets
Other templates: Products/CMFPlone/skins/
Override Viewlets
PLONE SYMPOSIUM EAST 2011
From plone/app/layout/viewlets:
* viewlet-specific code in configure.zcml
* viewlet template
Override Viewlets
PLONE SYMPOSIUM EAST 2011
Put overrides into theme/browser:
* configure.zcml
- update relative paths (manager, class)
- add template=”...
- add layer=”.interfaces.IThemeSpecific”
* viewlet template
Override Viewlets: z3c.jbot
PLONE SYMPOSIUM EAST 2011
Or use z3c.jbot!
In theme/browser/configure.zcml:
<include package=”z3c.jbot” file=”meta.zcml” />
<browser:templateOverrides
directory=”template-overrides”
layer=”.interfaces.IThemeSpecific” />
Override Viewlets: z3c.jbot
PLONE SYMPOSIUM EAST 2011
Templates can now go into
theme/browser/template-overrides named by
referencing the dotted path to the file:
plone.app.layout.viewlets.footer.pt
Override Portlets
PLONE SYMPOSIUM EAST 2011
In theme/browser/configure.zcml:
<include package=”plone.app.portlets” />
<plone:portletRenderer
portlet=”plone.app.portlets.portlets.events.
IEventsPortlet”
template=”events.pt”
layer=”interfaces.IThemeSpecific” />
Override Templates
PLONE SYMPOSIUM EAST 2011
If the original template is found in skins:
* put a copy in your theme/skins/ folder
* use the exact same name
* copy any associated .metadata files
* ex: Products/CMFPlone/skins/plone_content/
document_view.pt
Editing Actions
PLONE SYMPOSIUM EAST 2011
Parts of the site that use actions:
* personal bar (login, preferences, etc)
* main navigation Home link
* document actions (print, send)
* site actions (contact, accessibility, etc)
Editing Actions
PLONE SYMPOSIUM EAST 2011
* ZMI > portal_actions
* Export Action Providers
* remove extra code from actions.xml that you
did not adjust
Common Stumbling Blocks
PLONE SYMPOSIUM EAST 2011
What to look for when your changes are not
showing up
Flickr: gfpeck
Common Stumbling Blocks
PLONE SYMPOSIUM EAST 2011
1. Make sure the theme is installed
ZMI > portal_quickinstaller
Common Stumbling Blocks
PLONE SYMPOSIUM EAST 2011
2. Restart your instance
* .zcml
* .py
* new z3c.jbot override
Common Stumbling Blocks
PLONE SYMPOSIUM EAST 2011
3. Turn on Development mode
ZMI > portal_css
ZMI > portal_javascripts
Common Stumbling Blocks
PLONE SYMPOSIUM EAST 2011
4. Generic Setup - XML Files
* import changes in
ZMI > portal_setup > import tab
Common Stumbling Blocks
PLONE SYMPOSIUM EAST 2011
5. Check the custom folder
ZMI > portal_skins > custom
ZMI > portal_view_customizations > contents
Common Stumbling Blocks
PLONE SYMPOSIUM EAST 2011
5. Skins Order
ZMI > portal_skins > properties tab