Jump to >

djblets.extensions.templatetags.djblets_extensions

template_hook_point(parser, token)[source]

Registers a place where TemplateHooks can render to.

ext_static(parser, token)[source]

Outputs the URL to the given static media file provided by an extension.

This works like the {% static %} template tag, but takes an extension and generates a URL for the media file within the extension.

This is meant to be used with djblets.extensions.staticfiles.ExtensionFinder.

ext_css_bundle(parser, token)[source]

Outputs HTML to import an extension’s CSS bundle.

ext_js_bundle(parser, token)[source]

Outputs HTML to import an extension’s JavaScript bundle.

load_extensions_css(parser, token)[source]

Load all CSS bundles that can be rendered on the current page.

This will include all “default” bundles and any with an apply_to containing a URL name matching the current page.

Parameters:
  • context (django.template.Context) – The template context.
  • extension_manager_key (unicode) – The key for the extension manager for these bundles.
  • default_bundles (unicode) – A string containing a comma-separated list of bundles to always include. Defaults to "default".
Returns:

The HTML used to include the bundled content.

Return type:

unicode

load_extensions_js(parser, token)[source]

Load all JavaScript bundles that can be rendered on the current page.

This will include all “default” bundles and any with an apply_to containing a URL name matching the current page.

Parameters:
  • context (django.template.Context) – The template context.
  • extension_manager_key (unicode) – The key for the extension manager for these bundles.
  • default_bundles (unicode) – A string containing a comma-separated list of bundles to always include. Defaults to "default".
Returns:

The HTML used to include the bundled content.

Return type:

unicode

init_js_extensions(context, extension_manager_key)[source]

Initializes all JavaScript extensions.

Each extension’s required JavaScript files will be loaded in the page, and their JavaScript-side Extension subclasses will be instantiated.