David Convent - Theme It Yourself

3,871
-1

Published on

Live demonstration and talk on best tools and practices for themeing a Plone site, focusing on "what's new?" in Plone 3.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
3,871
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
124
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

David Convent - Theme It Yourself

  1. 1. Theme It Yourself Tools and Techniques for themeing a Plone 3.0 site David Convent 5th Plone Conference Naples – Oct 2007
  2. 2. The Audience I need to know what you need to learn (few questions)
  3. 3. About me ● Working at the Royal Belgium Institute of Naural Science ● Project: MARS (Multimedia Archaeological Research System) ● Contact: davconvent@gmail.com ● IRC: davconvent
  4. 4. This talk This talk is a tutorial, mostly given as a live demo. Detailed documentation on covered subjects is available on http://plone.org/documentation
  5. 5. Documentation http://plone.org/documentation/tutorial/creating-plone-themes http://plone.org/documentation/tutorial/genericsetup http://plone.org/documentation/tutorial/customizing-main-template-viewlets http://plone.org/documentation/tutorial/buildout
  6. 6. File System Development Good reasons for choosing to develop on the file system: ● Repeatable ● Version-able ● Testable ● Distributable ● Lets you do more
  7. 7. Tools for Initiating a new project ● Paste Script / paster $ paster create -t TEMPLATE [–svn-repository=REPOS] [–config=CONFIGFILE] [PROJECTNAME] ● ZopeSkel (demo) $ paster create –list-templates ● DIYPloneStyle
  8. 8. Anatomy of a theme package ● skins/ folder still there ● __init__.py is now empty (at least it can be) ● No Extensions/ folder, thus no Install.py module
  9. 9. Anatomy (continued) ● zcml files – configure.zcml – skins.zcml – profiles.zcml ● profiles/ folder ● browser/ module (sub package) – configure.zcml
  10. 10. Generic Setup ● Registering skins demo: Add new skin folder (skins.zcml + profiles/default/skins.xml) ● Registering stylesheets demo: browser/configure.zcml and profiles/default/cssregistry.xml
  11. 11. Zope 3 resources ● Images – Don't have Zope 2 image methods (i.e. the tag() method that generates and <img/> html tag) ● Stylesheets – Not ideal when DTML is needed
  12. 12. The stylesheet ● Important: manually set 'portal_css' in debug mode before starting any CSS work. ● Use of the Firefox 'Web Developer' add-on toolbar. ● Other handy Firefox extensions and add-ons: – View Source Chart – Aardvark – Firebug
  13. 13. xhtml output ● Strong advise: use default Plone output ● If changing the output is really needed... – Macros and slots in Zope 2 Page Templates – New Zope 3 Viewlets implementation in Plone 3
  14. 14. Playing with viewlets ● Viewlets and viewlet managers ● Viewlets in main template
  15. 15. Find your way ● @@manage-viewlets ● plone.app.layout.viewlets
  16. 16. Viewlet class methods ● self.render() ● self.update()
  17. 17. Adding a new viewlet ● Write class/template ● Declare viewlet in zcml ● Set up the order in GS profile
  18. 18. Overriding a viewlet ● Introduction to Zope 3 browser layers ● plone.theme ● plone.browserlayer
  19. 19. Thank you! Any further question? Announce: Join our team during the sprint and help us create new themes for Plone!

×