Daniel, The template in the View is the end page you want created for eg testview.html.
testview.html: {% extends "base.html" %} {% block content %}TEST VIEW WITH OBJECT{% endblock %} base.html: <body> <h2> {% block side_hdr %}here is the side menu for all pages{% endblock%} </h2> <p>{% block content %}Base{% endblock %}</p> </body> The end product looks like: <body> <h2>here is the side menu for all pages</h2> <p>TEST VIEW WITH OBJECT</p> </body> Does that make sense? So the testview.html extends the base. Everything in teh base appears in teh testview, and testview wil override anything from base. cheers L. On 18 August 2014 20:45, Daniel Grace <danwgr...@gmail.com> wrote: > I am struggling to understand block variables. I have two block variables > in my HTML template as follows: > > <h2> > {% block side_hdr %}{% endblock%} > </h2> > {% block content %}{% endblock %} > > How (if possible) do I set these variables in my class based view? > > class TestView(TemplateView): > template_name = "base.html" > > Thanks. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/43795e2f-1f53-4df7-ba5f-79477ccd2f08%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You have to be really clever to come up with a genuinely dangerous thought. I am disheartened that people can be clever enough to do that and not clever enough to do the obvious thing and KEEP THEIR IDIOT MOUTHS SHUT about it, because it is much more important to sound intelligent when talking to your friends. This post was STUPID. ----------------------------------------------------------------------------------------------------------- The Most Terrifying Thought Experiment of All Time http://www.slate.com/articles/technology/bitwise/2014/07/roko_s_basilisk_the_most_terrifying_thought_experiment_of_all_time.html -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGBeqiMjuQxwQ4d665GtZEg2xgJWbU-z8ro7sg2_dufVTG62RA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.