plone 5 theming unleashed

51
Plone 5 Theming Unleashed Albert Casado Víctor Fernández de Alba

Upload: sneridagh

Post on 15-Jul-2015

566 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Plone 5 theming unleashed

Plone 5 ThemingUnleashed

Albert CasadoVíctor Fernández de Alba

Page 2: Plone 5 theming unleashed

Albert

• Interaction designer – IxD / UI / UX

• New plone.org

• Plone 5 default Barceloneta theme

• new Plone 5 UI elements

@albertcasado

Page 3: Plone 5 theming unleashed

Víctor• Lead web developer and IT architect

• plone.app.multilingual

• New plone.org

• Plone 5 default Barceloneta theme

• Author of Plone 3 intranets (2010, PacktPub)@sneridagh

Page 4: Plone 5 theming unleashed

RelationshipGenweb (Plone 2.5), Genweb 3 (Plone 4), UPC.edu (Plone 3), UPC.tv (Plone 3) …

Page 5: Plone 5 theming unleashed

Designer-frontend developer

• Visual designer (PS, Ai)

• HTML/CSS expert, cross-browsing and accessibility

• At least basic JS (jquery, integrator of other libs)

• Knows about Plone internals and structure

• <Knowing=“Diazo” helps />

Page 6: Plone 5 theming unleashed

Plone backend developer

• Proficient Plone developer

• Good CSS & HTML

• Strong JS

• Diazo and XSLT

• Limited design capabilities and doubtful taste ;)

Page 7: Plone 5 theming unleashed
Page 8: Plone 5 theming unleashed

New all-in-one toolbar

Page 9: Plone 5 theming unleashed

Toolbar markup

Page 10: Plone 5 theming unleashed

Friendlier Site setupStay in this room: next talk Resource Registry

Page 11: Plone 5 theming unleashed

Rewritten UI elements

Page 12: Plone 5 theming unleashed

Rewritten UI elements

Page 13: Plone 5 theming unleashed

New markup: less Diazo• Updated Header

• Updated Navigation

• Updated Breadcrumbs

• Updated Alerts

• Updated Portlets

• Updated Search

• …

• Just turn off Diazo adding ?diazo.off=1

Page 14: Plone 5 theming unleashed

Diazo off = Plone naked

Designer, really, save this: ?diazo.off=1

Page 15: Plone 5 theming unleashed

/test_rendering

All usual elements in one page

Page 16: Plone 5 theming unleashed

Fontello fontUpdatable with JSON file: you all can update easily to your own glyphs

Page 17: Plone 5 theming unleashed

.context:extend(.btn-primary) { }

We all like Bootstrap, but use Plone classes instead

Page 18: Plone 5 theming unleashed

So Plone 5 is• HTML5

• ARIA & WCAG

• Responsive

• LESS

• Best JS ever

• No layout tables

• DL DT DD with pleasure!

• Updated .pt files

• Clever setup

Page 19: Plone 5 theming unleashed

Many things has been updatedAccessibility Addons Alerts Assignments Autotabs Breadcrumbs Buttons Code Control panel Dashboard Document by line Dropzone Error page

Event Folder listing Forms Fullscreen image Header Image product Login Mail reset Maintenance Manage portlets Members Mixins Modal Navigation

News Pagination Pick a date Portlets Recenty modified Search results Sharing Site map Site nav Sortable States Strutcture Tabbing Tables

Tablesorter Thumbs TOC Toolbar Tree Types User settings Variables Views …

Check everything on Barceloneta

Page 20: Plone 5 theming unleashed

Just a recap for best practices!

Page 21: Plone 5 theming unleashed

Designer frontend developer

• Learn basic rules of Diazo

• Reuse the fine existing Plone markup

• Understand Plone structure

• Have in mind Plone default classnames

• Prototype in static HTML: Prototype, prototype, prototype

• A “vainilla” Plone site to experiment with

Page 22: Plone 5 theming unleashed

Plone structureHeader

Nav

Breadcrumbs

Alerts

<main>

Portlets

Left

Column

Portlets footer

Footer

Portlets

Right

Column

Content

Page 23: Plone 5 theming unleashed

Plone classes and IDs• .portlet .portletNews

• .formHelp, .formControls

• .context, .standalone, .destructive

• .documentFirstHeading

• #portal-column-content

• #edit-bar

Page 24: Plone 5 theming unleashed

Do not create from scratch

• Use the default Plone’s HTML before Diazoing

• Understand Plone structure and distribution of elements, reuse it!

• Copy/Reuse Barceloneta LESS and adapt it

Page 25: Plone 5 theming unleashed

Ei designer: prototype

• If you reuse Plone structure…

• If you reuse Plone classes…

• If you reuse Plone elements…

Developers will love you

Page 26: Plone 5 theming unleashed

Transfer prototype into a Diazo Theme for Plone

Page 27: Plone 5 theming unleashed

About prototyping

• Prototype based on the default Plone markup as far as possible

• Know the limits of prototyping (:after limits sitelive)

• Start to build the theme using the prototypes as baseline

Page 28: Plone 5 theming unleashed

Use a package generator

• Works with Plone 5.

• We’ll have to add some new things, specially new resource registries GenericSetup .xml

https://github.com/collective/zopeskel.diazotheme/

Page 29: Plone 5 theming unleashed

Diazo• Use Diazo to move blocks around

• Do easy modifications to the default markup

• Do not forget to make space for the toolbar just after the <body> tag with this rule:

<replace css:theme=“#portal-toolbar" css:content-children=“#edit-bar" css:if-not-content=“.ajax_load"

css:if-content=".userrole-authenticated"/>

Page 30: Plone 5 theming unleashed

Only if strictly needed

• Modify existing templates to match the prototypes ones using z3c.jbot for default viewlets, views and **portlets**

• Only when Diazo rules turn insane or overcomplicated is when “jboting” is easier, quicker and hassle free

Page 31: Plone 5 theming unleashed

Backend features

• Implement the backend features using the prototype’s markup for templates

Page 32: Plone 5 theming unleashed

Iterative improvement

• Over the Diazo theme in the development site

• Demo it to the customer frequently

• Iterate over the feedback and bugs found

Page 33: Plone 5 theming unleashed

Do not forget

• Add custom styling for standard user generated markup

Not anymore the custom you are thinking about

Page 34: Plone 5 theming unleashed
Page 35: Plone 5 theming unleashed

main_template

• No longer a portal_skins resource

• Now it’s a BrowserView

Products/CMFPlone/browser/templates/main_template.pt

Products/CMFPlone/browser/main_template.py

Page 36: Plone 5 theming unleashed

New Resource registries

• Completely updated for modern frontend developing

• Don’t want to reveal too much on them

Remember: Do not miss Rob’s and Ramon’s talk in this room after this talk

Spoilers

Page 37: Plone 5 theming unleashed

New Resource registriesBundles

Plone bundle

Barceloneta bundle

Legacy bundle

Resources

plone.less plone.js

barceloneta.plone.less

plone-legacy.lessplone-legacy.js

TTW customization and overrides

Spoiler Alert!

Page 38: Plone 5 theming unleashed

New Resource registriesSpoiler Alert!

Page 39: Plone 5 theming unleashed

New Resource registriesSpoiler Alert!

manifest.cfg

Page 40: Plone 5 theming unleashed

Development mode

• Compilation on browser of LESS/JS resources

• Compilation on console via grunt watch task

Spoiler Alert!

Page 41: Plone 5 theming unleashed

Production mode

Have we said that you should assist to the next talk?

Spoiler Alert!

Page 42: Plone 5 theming unleashed

Plone 5 Barceloneta

Barcelona, Catalonia

Page 43: Plone 5 theming unleashed

Pretty well ordered plonetheme > barceloneta > static > less

Page 44: Plone 5 theming unleashed

Why not SASS?

• LESS is done in JS and can be compiled in browser

• Because we decided it and we don’t care.

• Still not convinced? https://github.com/ekryski/less2sass

Page 45: Plone 5 theming unleashed

Plone 5 and Barceloneta

Page 46: Plone 5 theming unleashed
Page 47: Plone 5 theming unleashed

Deductible LESS

structure and file naming

Page 48: Plone 5 theming unleashed

Just modify variables

Page 49: Plone 5 theming unleashed

Reuse Barceloneta LESS

@import "@{sitePath}/++plone++barceloneta/less/variables.plone.less";

Page 50: Plone 5 theming unleashed

Let’s Plone a bit

Page 51: Plone 5 theming unleashed

Thanks / Gràcies@albertcasado

@sneridagh