Creating a new theme for Plone: a real-world example
This Tutorial applies to:
Plone 2.5.x, Plone 2.1.x
This Tutorial is intended for:
Integrators, Customizers
limi
All content on one page (useful for printing, presentation mode etc.)
- Introduction Introduction to the tutorial, and the new theme approach made possible using Plone 2.1 and later versions.
- Toolchain Quick walk-through of the different tools we have at our disposal to create and inspect CSS-based designs.
- Real-world use case For our purposes, we will show how to build a theme from a Photoshop mock-up.
- A proper foundation Before we start adding our CSS styles, we need to create the basic foundation for our theme. This is essentially a blank skeleton product that we can put our images and CSS inside.
- Scaffolding Before we can start writing CSS, we are going to do some structural changes and export the graphical elements.
- Adding CSS styles Finally, it's time to apply our CSS styles. Each step is illustrated by an image showing the progression of the theme.
- Header styles First up, the site header.
- Basic styles Adding the basic body styles.
- Background image styles Adding a background image and locking the width of the design.
- Headline and paragraph styles Adding styles for headlines and paragraphs.
- List styles Making the lists be displayed inline and without bullets.
- Portlet and navigation styles Adding proper styles to the portlets and the navigation tree in particular.
- Re-positioning the navigation Removing redundant margins on the portlets and navigation tree.
- Footer styles Final element, styling the footer.
- Tips for creating your own Plone Themes Some useful tips for making your site designs stand out and work well with future versions of Plone.
see also:
-
DIYPloneStyle: Creating a Custom Style for Plone
- This tutorial will teach you how DIYPloneStyle can be used as a base for creating a custom style product for Plone 2.1 or Plone 2.5 that adds to a portal a new skin selection and makes use of the new stylesheet and javascript registries.
Copying the main_template
This site encountered an error trying to fulfill your request. The errors were:
Error Type
Copy Error
Error Message
! The object main_template does not support this operation.
I am unsure of how to successfully copy a version of the main_template into my newly created DIYPloneStyle Theme. Any clarification you could offer would be most helpful.
Thank You,
Adam Blake
Content Overlaps & a few other fixes
the searchbox overlaps the calendar (it's right on top of the calendar) and it also overlaps the main content area ("Welcome to Plone").
In the example the content area seems to start 10-20px below the bottom of the search box, but on my setup it starts about 10-20px below the header logo.
Any suggestions?
---
A few other comments (issues I've solved)
* Firefox 2 on Ubuntu 6.10 doesn't seem to like the margin settings for lists that have been put onto one line - as I resize the browser window, it keeps jumping between one and two lines, eg:
username Preferences Undo Logout
and
username Preferences Undo
Logout
It flicks between them every 2-3 pixels of resizing the window.
It works ok just using padding-left, like #portal-siteactions. (I actually ended up setting all the formatting for #portal-personaltools to be the same as #portal-siteactions, except no border-left and I set padding-left to 1em.
* To line up the Navigation with the image, I had to get rid of the .portletItem padding:
.portletItem {
/* padding: 0.5em;*/
}
---
A few things that were missed in the tutorial (perhaps because I'm using Plone 2.5.2 and things have changed?):
* get rid of the stuff that's meant to be hidden:
.hiddenStructure {
display: none;
}
---
* to kill the the underlines in the footer, you need more than just
#portal-footer a, a:visited
because the underline is set in:
p a:link
as there are p tags inside the footer which make the formatting inconsistent. Editing the footer to remove p tags may be a better way to go.
-------
I am using Plone 2.5.2, Zope 2.9.6, Python 2.4.4.
Showing / Hiding breadcrumbs?
/* Navigation */
#portal-breadcrumbs {
margin: 1em 1em 1em 19em;
}
#portal-breadcrumbs {
display: none;
}
--Aaron
Nice Tutorial
This is a great newby tutorial. I had a couple of suggestions for improvements:
- It would be good to add a note showing people how to turn on debugging for CSS in the CSS Registries tool. IE and FF both are a little flaky with caching CSS changes. I have found it very helpfu lwhen working with skin to have the CSS debug turned on.
- It is not always immediately apparent to the novice how exactly to create a new template. So I suggest adding something about how to do this when you start talking about main_template. Either thru the ZMI or on the file system.
beren
skins and logos
Ah, an IE6 hack
Spanish version - Traducción al español
Suggested Wording
"This will generate an empty skeleton product called MyTheme where all our files can be placed in our Products directory."
might better read as something like:
"This will generate and place in the Products directory a new skeleton product called MyTheme where all our files can be placed."
At least to me, the first sentence doesn't seem to flow enough to allow the user to easily connect that running the generator.py script generates a new directory somewhere. It confused me at first (though I'm simple minded.) :)
Very nice guide
Between step 6 and 7 the calendar is removed, but I had some trouble finding out how to do it myself, an explanaiton on how to do that the best way would be great.