Download - Getting Plone Ready For The Prom

Transcript
Page 1: Getting Plone Ready For The Prom

03.12.2008

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

Getting Plone Ready for the Prom - Clayton Parker

Getting Plone Ready for the PromPlone Symposium East 2008

Clayton ParkerMarch 12, 2008

Page 2: Getting Plone Ready For The Prom

03.12.2008

Six Feet Up, Inc. • http://www.sixfeetup.com Silicon Valley • Midwest

Getting Plone Ready for the Prom - Clayton Parker

Who Am I?

• Plone developer since 2003• Lead Developer at Six Feet Up, Inc.• All around nice guy :)

Page 3: Getting Plone Ready For The Prom

03.12.2008

Six Feet Up, Inc. • http://www.sixfeetup.com Silicon Valley • Midwest

Getting Plone Ready for the Prom - Clayton Parker

What are we in for?

• Approaches to skinning Plone• Tools used• Advanced techniques

Page 4: Getting Plone Ready For The Prom

03.12.2008

Six Feet Up, Inc. • http://www.sixfeetup.com Silicon Valley • Midwest

Getting Plone Ready for the Prom - Clayton Parker

Where to start

• Debug mode• $INSTANCE_HOME/bin/zopectl fg• $buildout/bin/instance fg• zope.conf

• debug-mode on

Page 5: Getting Plone Ready For The Prom

03.12.2008

Six Feet Up, Inc. • http://www.sixfeetup.com Silicon Valley • Midwest

Getting Plone Ready for the Prom - Clayton Parker

More debug modes

• portal_css• portal_javascripts• portal_kss

Page 6: Getting Plone Ready For The Prom

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

03.12.2008Getting Plone Ready for the Prom - Clayton Parker

Get to know Plone

Page 7: Getting Plone Ready For The Prom

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

03.12.2008Getting Plone Ready for the Prom - Clayton Parker

Get to know Plone

Page 8: Getting Plone Ready For The Prom

03.12.2008

Six Feet Up, Inc. • http://www.sixfeetup.com Silicon Valley • Midwest

Getting Plone Ready for the Prom - Clayton Parker

Theories of Skinning

• Light Skinning• use base_properties

Page 9: Getting Plone Ready For The Prom

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

03.12.2008Getting Plone Ready for the Prom - Clayton Parker

base_properties

title:string=Plone's color, font, logo and border defaults

plone_skin:string=Plone Default

logoName:string=logo.jpg

fontFamily:string="Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-seriffontBaseSize:string=69%fontColor:string=BlackfontSmallSize:string=90%

backgroundColor:string=White

linkColor:string=#436976linkActiveColor:string=RedlinkVisitedColor:string=Purple

borderWidth:string=1pxborderStyle:string=solidborderStyleAnnotations:string=solid

Page 10: Getting Plone Ready For The Prom

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

03.12.2008Getting Plone Ready for the Prom - Clayton Parker

css.dtml?

/* <dtml-with base_properties> (do not remove this :) *//* <dtml-call "REQUEST.set('portal_url', portal_url())"> (not this either :) */

Page 11: Getting Plone Ready For The Prom

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

03.12.2008Getting Plone Ready for the Prom - Clayton Parker

Example in the wildbody { font: &dtml-fontBaseSize; <dtml-var fontFamily>; background-color: &dtml-backgroundColor;; color: &dtml-fontColor;; margin: 0; padding: 0;}table { font-size: 100%;}a { color: &dtml-linkColor;; background-color: transparent;}img { border: none; vertical-align: middle;}p { margin: 0 0 0.75em 0; line-height: 1.5em;}

pulled from base.css.dtml

Page 12: Getting Plone Ready For The Prom

03.12.2008

Six Feet Up, Inc. • http://www.sixfeetup.com Silicon Valley • Midwest

Getting Plone Ready for the Prom - Clayton Parker

Building on the base

• ploneCustom.css• override plone styles

Page 13: Getting Plone Ready For The Prom

03.12.2008

Six Feet Up, Inc. • http://www.sixfeetup.com Silicon Valley • Midwest

Getting Plone Ready for the Prom - Clayton Parker

Going all the way

• Clean the slate• Leave just authoring.css

Page 14: Getting Plone Ready For The Prom

03.12.2008

Six Feet Up, Inc. • http://www.sixfeetup.com Silicon Valley • Midwest

Getting Plone Ready for the Prom - Clayton Parker

TTW vs FS

Page 15: Getting Plone Ready For The Prom

03.12.2008

Six Feet Up, Inc. • http://www.sixfeetup.com Silicon Valley • Midwest

Getting Plone Ready for the Prom - Clayton Parker

Now I’m convinced.

• DIYPloneStyle• ZopeSkel• GenericSetup

Page 16: Getting Plone Ready For The Prom

03.12.2008

Six Feet Up, Inc. • http://www.sixfeetup.com Silicon Valley • Midwest

Getting Plone Ready for the Prom - Clayton Parker

Resource registries

• portal_css• portal_javascripts

Page 17: Getting Plone Ready For The Prom

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

03.12.2008Getting Plone Ready for the Prom - Clayton Parker

Resource registries

Page 18: Getting Plone Ready For The Prom

03.12.2008

Six Feet Up, Inc. • http://www.sixfeetup.com Silicon Valley • Midwest

Getting Plone Ready for the Prom - Clayton Parker

Advanced techniques

Page 19: Getting Plone Ready For The Prom

03.12.2008

Six Feet Up, Inc. • http://www.sixfeetup.com Silicon Valley • Midwest

Getting Plone Ready for the Prom - Clayton Parker

Viewlets

• New to Plone 3• More control over the main_template

Page 20: Getting Plone Ready For The Prom

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

03.12.2008Getting Plone Ready for the Prom - Clayton Parker

Using @@manage-viewlets

Page 21: Getting Plone Ready For The Prom

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

03.12.2008Getting Plone Ready for the Prom - Clayton Parker

Using @@manage-viewlets

Page 22: Getting Plone Ready For The Prom

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

03.12.2008Getting Plone Ready for the Prom - Clayton Parker

Using @@manage-viewlets

Page 23: Getting Plone Ready For The Prom

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

03.12.2008Getting Plone Ready for the Prom - Clayton Parker

Layers

from plone.theme.interfaces import IDefaultPloneLayer

class IThemeSpecific(IDefaultPloneLayer): """Marker interface that defines a Zope 3 browser layer. If you need to register a viewlet only for the "example" theme, this interface must be its layer (in theme/viewlets/configure.zcml). """

Page 24: Getting Plone Ready For The Prom

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

03.12.2008Getting Plone Ready for the Prom - Clayton Parker

Layers

<interface interface=".interfaces.IThemeSpecific" type="zope.publisher.interfaces.browser.IBrowserSkinType" name="example" />

Page 25: Getting Plone Ready For The Prom

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

03.12.2008Getting Plone Ready for the Prom - Clayton Parker

Moving viewlets

<browser:viewlet name="plone.abovecontenttitle.documentactions" manager="plone.app.layout.viewlets.interfaces.IAboveContentTitle" class="plone.app.layout.viewlets.content.DocumentActionsViewlet" permission="zope2.View" layer=".interfaces.IThemeSpecific" />

Page 26: Getting Plone Ready For The Prom

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

03.12.2008Getting Plone Ready for the Prom - Clayton Parker

Overriding viewlets

<browser:viewlet name="plone.footer" for="*" manager="plone.app.layout.viewlets.interfaces.IPortalFooter" template="mytheme_footer.pt" permission="zope.Public" layer= ".interfaces.IThemeSpecific" />

Page 27: Getting Plone Ready For The Prom

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

03.12.2008Getting Plone Ready for the Prom - Clayton Parker

z3c.jbot

eggs = z3c.jbotzcml = z3c.jbot-meta

<browser:templateOverrides directory="templates" />

templates/plone.app.layout.viewlets.footer.pt

Page 28: Getting Plone Ready For The Prom

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

03.12.2008Getting Plone Ready for the Prom - Clayton Parker

Overriding portlets

<plone:portletRenderer portlet="plone.app.portlets.portlets.news.INewsPortlet" template="mytheme_news.pt" layer=".interfaces.IThemeSpecific" />

Page 29: Getting Plone Ready For The Prom

Silicon Valley • MidwestSix Feet Up, Inc. • http://www.sixfeetup.com

03.12.2008Getting Plone Ready for the Prom - Clayton Parker

Zope 3 resources

<browser:resourceDirectory name="example-app-images" directory="images" layer=".interfaces.IThemeSpecific" />

/++resource++example-app-images/foo.jpg

Page 30: Getting Plone Ready For The Prom

03.12.2008

Six Feet Up, Inc. • http://www.sixfeetup.com Silicon Valley • Midwest

Getting Plone Ready for the Prom - Clayton Parker

The Future

Page 31: Getting Plone Ready For The Prom

03.12.2008

Six Feet Up, Inc. • http://www.sixfeetup.com Silicon Valley • Midwest

Getting Plone Ready for the Prom - Clayton Parker

FIN

Page 32: Getting Plone Ready For The Prom

03.12.2008

Six Feet Up, Inc. • http://www.sixfeetup.com Silicon Valley • Midwest

Getting Plone Ready for the Prom - Clayton Parker

Questions?

Page 33: Getting Plone Ready For The Prom

03.12.2008

Six Feet Up, Inc. • http://www.sixfeetup.com Silicon Valley • Midwest

Getting Plone Ready for the Prom - Clayton Parker

Support

http://plone.org/documentationhttps://weblion.psu.edu/trac/weblion/wiki/WebDevelopmenthttp://plone.org/documentation/how-to/firefox-toolshttp://plone.org/documentation/tutorial/creating-plone-themeshttp://plone.org/documentation/tutorial/customizing-main-template-viewletshttp://plone.org/documentation/tutorial/zptProfessional Plone Development Bookhttp://www.packtpub.com/Professional-Plone-web-applications-CMS/book