Skip to content

Latest commit

 

History

History
65 lines (45 loc) · 1.29 KB

asset.rst

File metadata and controls

65 lines (45 loc) · 1.29 KB

asset

The asset directive adds an asset override for a single static file/directory asset.

Attributes

to_override

A asset specification specifying the asset to be overridden.

override_with

A asset specification specifying the asset which is used as the override.

Examples

Overriding a Single Asset File

<asset
  to_override="some.package:templates/mytemplate.pt"
  override_with="another.package:othertemplates/anothertemplate.pt"
/>

Overriding all Assets in a Package

<asset
  to_override="some.package"
  override_with="another.package"
 />

Overriding all Assets in a Subdirectory of a Package

<asset
  to_override="some.package:templates/"
  override_with="another.package:othertemplates/"
 />

Alternatives

The pyramid.config.Configurator.override_asset method can be used instead of the resource ZCML directive.

This directive can also be invoked as the resource ZCML directive for backwards compatibility purposes.

See Also

See also asset_zcml_directive.