bobtemplates.plone provides a mr.bob template to generate packages for Plone projects.
To create a package like
$ mrbob -O collective.myaddon bobtemplates.plone:addon
You can also create a package with nested namespace:
$ mrbob -O collective.foo.myaddon bobtemplates.plone:addon
On creating a package you can choose from the following options. The default value is in [square brackets]:
- Package Type? [Basic]
Options are Basic, Dexterity and Theme.
- Author’s name
Should be something like ‘John Smith’.
- Author’s email
Should be something like ‘email@example.com’.
- Author’s github username
Should be something like ‘john’.
- Package description [An add-on for Plone]
One-liner describing what this package does. Should be something like ‘Plone add-on that …’.
- Plone version [4.3.4]
Which Plone version would you like to use?
- Add example view? [True]
Do you want to register a browser view ‘demoview’ as an example?
Package created with
bobtemplates.plone use the current best-practices when creating an addon.
The package is contained in a buildout that allows you to build Plone with the new package installed for testing-purposes.
The package comes with a test setup and some tests for installing the package. It also contains a robot-test that tests logging in. The buildout also contains a config to allow testing the package on travis that sends notifications by email to the package autor.
The package contains a Generic Setup Profile that installs a browserlayer.
The package registers a directory for locales.
The package registers the folder
browser/overridesas a directory where you can drop template-overrides using z3c.jbot.
The package contains a setuphandlers.py where you can add code that is executed on installing the package.
Addons created with
bobtemplates.plone are tested to work in Plone 4.3.x and Plone 5.
They should also work with older versions but that was not tested.
Use in a buildout¶
[buildout] parts += mrbob [mrbob] recipe = zc.recipe.egg eggs = mr.bob bobtemplates.plone
This creates a mrbob-executeable in your bin-directory.
Call it from the
src-directory of your Plone project like this.:
$ ../bin/mrbob -O collective.foo bobtemplates.plone:addon