Skip to main content

Drop-in template overrides.

Project description

Overview

The z3c.jbot (or “Just a bunch of templates”) package allows drop-in page template overrides.

It works by giving page templates a canonical filename which you can use to provide a replacement in your own package. Simply register a template overrides directory and give your new template the canonical filename.

Overrides may be registered for a specific layer or any layer.

Canonical filename

The canonical filename is defined as the path relative to the package within which the template is located with directory separators replaced with dots.

Example:

Suppose you want to override: /plone/app/layout/viewlets/logo.pt

You would use the filename: plone.app.layout.viewlets.logo.pt

Registering a on overrides directory

A Zope component configuration directive is available to configure overrides:

<include package="z3c.jbot" file="meta.zcml" />

<browser:templateOverrides
    directory="<directory>"
    layer="<layer>" />

Performance considerations

The use of jbot adds to the general page load time. On a site with many templates this may be as much as 10 ms per request.

Author

Malthe Borch <mborch@gmail.com>

Changes

0.3 (2009-09-26)

  • Improved test coverage.

  • Refactored code, improving performance.

  • Fixed issue with multiple layers.

0.2 (2008-07-14)

  • Added layer support.

0.1 (2007-11-27)

  • Initial public release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

z3c.jbot-0.3.tar.gz (10.2 kB view details)

Uploaded Source

File details

Details for the file z3c.jbot-0.3.tar.gz.

File metadata

  • Download URL: z3c.jbot-0.3.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for z3c.jbot-0.3.tar.gz
Algorithm Hash digest
SHA256 ec72fa9db585813df01df9d945c404813e76b9c5bba471d52cf145b6f03b5259
MD5 0a2fb130f061ff48d7d3426d001eeb84
BLAKE2b-256 d0b73a2f276b561fa94bc704288c18d4fb597b0db4f166e57d10fdbfd1247c09

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page