Overriding Templates Using z3c.jbot (for Diazo)

Using collective.jbot to override templates in your Diazo theme on Plone 5

As I mentioned previously, z3c.jbot allows you to customise plone templates without having to go through portal_view_customizations.

There is a nifty little add-on called collective.jbot which allows you to make use of the power of z3c.jbot but without needing to access the file system!

At this time of writing there is a bug with the control panel property, but nothing which stops you using this add-on in your theme.

To install:

buildout.cfg

eggs = 
[...]
collective.jbot

Then update the installation:

bin/plonectl stop 

Then run buildout under the plone_buildout user (as required by Plone 5)

sudo -u plone_buildout bin/buildout

To use:

Load up your @@theming-controlpanel (go to Site Setup > Theming)

Create a folder within the root of your theme named: jbot

Inside this new jbot folder you can put your templates you want to override.

You must name the template according to the original jbot requirements, so if you go to portal_view_customizations, find the template you want to override and look for template file heading, copy everything after the egg part of the path and replace the slashes with dots.

Example:

The summary_view template (found in portal_view_customizations):

view name
    summary_view
registered for interface
    plone.dexterity.interfaces.IDexterityContainer
registered for request type
    plone.app.contenttypes.interfaces.IPloneAppContenttypesLayer
template file
    /opt/plone/buildout-cache/eggs/plone.app.contenttypes-1.2.4-py2.7.egg/plone/app/contenttypes/browser/templates/listing_summary.pt
zcml file
    plone.app.contenttypes.browser/configure.zcml

So the template file would need to be named:

plone.app.contenttypes.browser.templates.listing_summary.pt