subtemplates in bobtemplates.plone

or on the way to plonecli

Maik Derstappen

once upon the time

creating Plone packages was easy as this

zopeskel dexterity collective.todo
cd collective.todo
paster addcontent -t contenttype TodoDB
paster addcontent -t contenttype Todo

but

  • ZopeSkel is dead

Plone is using mr.bob for some years already

  • it's smaller
  • templates are easier to build and test

but

  • existing templates where really basic
  • no real option to add content types or other peaces
  • no list of available templates

hard to remember commands

mrbob bobtemplates:plone_addon -O collective.todo

so let's fix that!

vision

give me a tool which helps

  • creating different packages (addon, buildout, ...)
  • extending packages with content types, vocabularies, theme, ...
  • provide best practice skeletons
  • provides basic tests for generated code
  • easy usage on cli

something like this

creating a Plone addon

$ pip install plonecli
$ plonecli -l
templates:
 - addon
  - content_type
  - theme
  - vocabulary
 - buildout

$ plonecli create addon collective.todo

adding features to your Plone addon

$ cd collective.todo
$ plonecli -l
templates:
 - content_type
 - theme
 - vocabulary

$ plonecli add content_type
$ plonecli add vocabulary
$ plonecli add theme

nice, wouldn't be?

so when can we have it?

most of it, is already done

bobtemplates.plone 3

  • more standalone templates
  • subtemplates to gradually extend a package
  • everything can be tested (template and the resulting package)

standalone templates

  • addon: basic Plone addon
  • buildout: development/project buildout
  • theme_package: full theme package (Barceloneta based incl. Grunt setup)

subtemplates

  • content_type: Dexterity content type (XML/zope.schema)
  • vocabulary: dynamic vocabulary
  • theme: advanced theme (incl. themesidesetup and themefragments)
  • more to come: tile, behavior, portlet, ... ;)

example create Plone addon

$ mrbob bobtemplates.plone:addon -O collective.todo

example add content_type to your Plone addon

$ cd collective.todo
$ mrbob bobtemplates.plone:content_type

mr.bob (github.com/MrTango/mr.bob)

  • new option --list-templates

So we are not that far from the plonecli

plonecli

  • provides a CLI on for Plone related bobtemplates
  • depends on bobtemplates.plone and maybe others
  • short commands
  • autocomplition of template names

we will sprint on that

  • so please join
  • contribute to bobtemplates.plone templates

Thank You!

Maik Derstappen - md@derico.de

Slides are online: http://derico.gitlab.io/mrbob-plonecli-ploneconf2017