Add a "global" option for the {% definevar %} template tag.

Review Request #10953 — Created March 14, 2020 and submitted

chipx86
Djblets
release-2.0.x
djblets

This adds a new option to {% definevar %} that allows a variable to be
registered in the top-most template context, ensuring the variable
survives past the current scope. This is useful for defining something
within a template that's intended for use in several distinct blocks,
such as a unique ID or URL that has to be referenced in several places.

It's recommended that consumers have a standard block in a base template
defined before any other blocks or logic that is reserved for global
variable definitions, in order to ensure that these variables are
defined before they're used.

Unit tests passed.

Successfully used this with some upcoming work in Review Board.

Summary
Add a "global" option for the {% definevar %} template tag.
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (f475537)
Loading...