{{store_address.street}}
{{store_address.city}},{{store_address.state}}
We offer: {{store_amenities.0}} and {{store_amenities.1}}
Menu includes : {{store_menu.1.1}} and {{store_menu.2.1}}
{% block breadcrumb %}Home{% endblock breadcrumb %}
# index.html template {% extends "base.html" %} {% block breadcrumb %}Main{% endblock breadcrumb %} # detail.html template {% extends "index.html" %} {% block breadcrumb %} {{block.super}} : Detail {% endblock breadcrumb %} The base.html template in Listing 3-12 defines the breadcrumb block with a default value of Home. Next, the index.html template reuses the base.html template and overrides the breadcrumb block with a value of Main. Finally, the detail.html template reuses the index.html template and overrides the breadcrumb block value. However, notice the {{block.super}} statement in the final block override. Since {{block.super}} is inside the breadcrumb block, {{block.super}} tells Django to get the content from the parent template block. Another reusability functionality in Django templates is the inclusion of a Django template inside another Django template. Django supports this functionality through the {% include %} tag. The {% include %} tag expects a template argument – similar to the {% extend %} tag – which can be either a hard-coded string reference (e.g., {% include "footer.html" %} ), a relative path to a template (e.g., {% include "../header.html" %}), or a variable passed by a view that can be a string or Template object loaded in the view. Templates declared as part of {% include %} tags are made aware of context variables in the template that declares them. This means if template A uses the {% include "footer.html" %} tag, template A variables are automatically made available to the footer.html template. Inclusively, it's possible to explicitly provide context variables to {% include %} statements using the with keyword. For example, the statement {% include "footer.html" with year="2013" %} makes the year variable accessible inside the footer.html template. The {% include %} tag also supports the ability to pass multiple variables using the with notation (e.g., {% include "footer.html" with year="2013" copyright="Creative Commons" %}). Finally, if you want templates declared as part of {% include %} tags to have restricted access to context variables from the template that declares them, you can use the only keyword. For example, if template B uses the {% include "footer.html" with year="2013" only %} statement, the footer.html template only gets access to the year variable, irrespective of the variables available in template B. Similarly, the {% include "footer.html" only %} statement restricts the footer.html template to no variables, irrespective of the variables available in the template that uses the statement.385 Main
San Diego, CA