Template Inheritance in Django -


I am using Django 1.1, and I have this template, the base template, which is from all other pages. It defines a set of things that are stabilized during the entire website, such as this Naubar:

  & lt; Div id = "navbar" & gt; {% Block navbar%} & lt; A href = "" & gt; Link 1 & lt; / A & gt; & Lt; A href = "" & gt; Link 2 & lt; / A & gt; & Lt; A href = "" & gt; Link 3 & lt; / A & gt; & Lt; A href = "" & gt; Link 4 & lt; / A & gt; & Lt; A href = "/ admin /" & gt; Admin & lt; / A & gt; {% Endblock%} & lt; / Div & gt;  

But in the child's templates, in default behavior of the child, the child has to completely override the blocks in the original template. I have found this page here that it is not necessary that you have to override the Nebar block, just add some more entries in it that are specific to that page, but the only way I can see is that if I am a parent, To make a copy of the Naubar block from the father and then to include it in the template + my extra, is there any other way that can be done?

Use {{block.super}} parent block In the child's template to include content from


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -