#216: Template overrides
- Proposed by
- Malthe Borch
- Proposal type
- Architecture
- Repository branch
- z3c.jbot
- State
- being-discussed
Definitions
JBOT - just a bunch of templates.
Motivation
The entry bar for customizing the default skin of Plone is too high as it is; z3c.jbot makes overriding templates easy by letting developers register one or more 'overrides' directories and simply dump customized templates in there. Only requirement is that a simple naming convention is followed:
If the template resides in, say, browser/templates/logo.pt inside the plone.app.layout package, the canonical override key would be 'plone.app.layout.browser.templates.logo.pt". A registry of the available override templates for each directory is frozen upon startup. Changes to the template file will be picked up at run-time (in development mode), but new files won't be picked up after startup.
The jbot-approach is an easy way to get started and it scales in the sense that if you later need to add custom logic or other customization of the registration, it's as simple as moving the file and doing a proper zcml registration.
It's really an alternative to named templates and I think it's preferable to use canonical names rather than conventional names.
Proposal
Integrate z3c.jbot (probably rebranded) into the core distribution. Add (more) documentation.
Implementation
Currently it's a monkey on zope.pagetemplate. The package hooks into the render-method of the template querying jbot's template manager to see if it should use a different file. There's a negligible overhead.
Risks
This does introduce two ways of customizing Plone. But it's a way that's very similar to that of previous Plones.
Progress log
Package is done; more documentation is needed.
Participants
malthe
Framework team vote