Tags

Cloud browser template tags.

class cloud_browser.templatetags.cloud_browser_extras.MediaUrlNode(rel_path)

Media URL node.

render(context)

Render.

static_media_url = None

Static application media URL (or None).

cloud_browser.templatetags.cloud_browser_extras.cloud_browser_media_url(_, token)

Get base media URL for application static media.

Correctly handles whether or not the settings variable CLOUD_BROWSER_STATIC_MEDIA_DIR is set and served.

For example:

<link rel="stylesheet" type="text/css"
    href="{% cloud_browser_media_url 'css/cloud-browser.css' %}" />
cloud_browser.templatetags.cloud_browser_extras.truncatechars(value, num, end_text='...')

Truncate string on character boundary.

Note

Django ticket 5025 has a patch for a more extensible and robust truncate characters tag filter.

Example:

{{ my_variable|truncatechars:22 }}
Parameters
  • value (string) – Value to truncate.

  • num (int) – Number of characters to trim to.