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

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

Overriding all Assets in a Package

1<asset
2  to_override="some.package"
3  override_with="another.package"
4 />

Overriding all Assets in a Subdirectory of a Package

1<asset
2  to_override="some.package:templates/"
3  override_with="another.package:othertemplates/"
4 />

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 The asset ZCML Directive.