Happy hacking with Plone
Éric Bréhault - PloneConf 2015
We, Plone developers
invest time in Plone,
build something nice and attractive,
feel pround of it.
We, Plone developers
from "Les Vacances du Petit Nicolas" by Laurent Tirard
.fx: extra-large
The users play
from "Les Vacances du Petit Nicolas" by Laurent Tirard
The conflict
They loved it.
We are desperate.
We retaliate
Pharmakon
φάρμακον: medecine, drug, poison
Any medecine is also a poison.
My solution
Hackability is a feature
It is not a flaw.
It must be provided as a tool.
A hacking tool...
to change or add whatever we want in our Plone site
through a modern and pleasant web interface
... not a hackable system
ZMI?
The Plone Theming editor!
Already a "hacking" tool:
non-Plone experts can change the entire theme.
Diazo theory
"We Write XSLT, So You Don't Have To"
Diazo reality
Guess what? I am writing tons of XSLT!!
What we need
Content-to-content
On-the-fly content changes with <before/>and <after/>.
< b e f o r e c s s : c o n t e n t = " # c o n t e n t - c o r e " >
< a h r e f = " m a i l t o : c o n t a c t @ d i a z o . o r g " >
A s k f o r h e l p
< / a >
< / b e f o r e >
Content-to-content
On-the-fly content insertion.
< b e f o r e c s s : c o n t e n t - c h i l d r e n = " # m a i n " >
< i n c l u d e c s s : c o n t e n t = " # b r e a d c r u m b s " / >
< / b e f o r e >
Content-to-content
On-the-fly remote content insertion.
< b e f o r e c s s : c o n t e n t - c h i l d r e n = " # m a i n " >
< i n c l u d e h r e f = " / n e w s "
c s s : c o n t e n t = " # b r e a d c r u m b s " / >
< / b e f o r e >
We want more
create our own chuncks of content
implement our own scripts
with basic knowledge of HTML and Python
Rapido
It lives in the theme
Editable through the Plone interface...
...or in the sources.
We use Diazo to inject it in Plone.
Dead simple
no ZCA stuff,
no ZPT (or any templating language),
no JBOT,
Just HTML and Python
Demo
What do we get in our
context?
context.app
context.request
context.portal
context.content
context.api(the Plone API!!)
Is it secure?
Python scripts are executed by
zope.security.untrustedpython.
All the regular security stack is applied, like:
current user privileges,
CSRF policy (@PostOnlyfor instance).
Battery included
Rapido comes with a complete REST API.
GET / POST / DELETE / PUT / PATCH
It is a ready-to-use JSON backend.
Demo
Battery included
Rapido provides a Plone Content Rules action.
We can hook our scripts to any Plone event.
Battery included
Rapido is Mosaic compliant.
(but it does not depend on it)
Demo
Thank you!
Happy hacking with Plone

Happy hacking with Plone