[Answer]-Djangocms template inheritance

1👍

Does your base.html contain {% block test %}?

Your base template must contain the block you want to override. You can add additional blocks in child templates, but they must be contained within a base block.

See https://docs.djangoproject.com/en/dev/topics/templates/#template-inheritance

👤Caspar

0👍

base.html is your top level template. This would normally be the thing that starts with an html doctype and ends with a </html> tag. Everything else has to have a place to go in there. All you have is a content block.

So where would the test block go? You’ve tried to put it in page1.html, but it still needs a place to go in the parent template.

Leave a comment