I have three html-files:
- base.html
- page.html
- comment.html
in page.html I extend base.html. In comment.html I extend page.html. Will comment.html extend base.html's blocks?
I have three html-files:
in page.html I extend base.html. In comment.html I extend page.html. Will comment.html extend base.html's blocks?
Yes, you can actually use as many levels of inheritance as you'd like. From The Django Book:
One common way of using inheritance is the following three-level approach:
(1) Create a base.html template that holds the main look-and-feel of your site. This is the stuff that rarely, if ever, changes.
(2) Create a base_SECTION.html template for each “section” of your site. For example, base_photos.html, base_forum.html. These templates all extend base.html and include section-specific styles/design.
(3) Create individual templates for each type of page, such as a forum page or a photo gallery. These templates extend the appropriate section template.
Yes, it will. Why not to try it yourself?