# \[SOLVED\] Block template inheritance

**URL:** https://discourse.gohugo.io/t/solved-block-template-inheritance/4302
**Category:** support
**Created:** [October 12, 2016, 11:57pm UTC](https://discourse.gohugo.io/t/solved-block-template-inheritance/4302 "2016-10-12T23:57:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![kaushalmodi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/kaushalmodi/32/2567_2.png) [@kaushalmodi](https://discourse.gohugo.io/u/kaushalmodi)
#### Post date: [October 12, 2016, 11:57pm UTC](https://discourse.gohugo.io/t/solved-block-template-inheritance/4302/1 "2016-10-12T23:57:19Z")

</div>

I read the Block templates doc page. But it was not clear how inheritance would work.

If I have a `layouts/_default/baseof.html`, does that effectively become `layouts/index.html`? Or do I still need that `index.html`?

Would `layouts/page/single.html` also inherit from `layouts/_default/baseof.html`? Or do I need a separate `baseof.html` for each subdirectory like `page/`, `categories/`, etc for taxonomies under `layouts/`?

---

<div class="post-metadata">

### Author: ![kaushalmodi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/kaushalmodi/32/2567_2.png) [@kaushalmodi](https://discourse.gohugo.io/u/kaushalmodi)
#### Post date: [October 13, 2016, 4:08am UTC](https://discourse.gohugo.io/t/solved-block-template-inheritance/4302/2 "2016-10-13T04:08:30Z")

</div>

I am able to answer my own set of questions here based on my experience [using the block templates](https://gitlab.com/kaushalmodi/kaushalmodi.gitlab.io/commit/c90705fe218db3f86034369dc51dd2ab6cc2abd8).

> If I have a `layouts/_default/baseof.html`, does that effectively become `layouts/index.html`? Or do I still need that `index.html`?

Not exactly. But the good thing is that you can override the blocks in `layouts/_default/baseof.html` using the `{{ define .. }}` syntax in `layouts/index.html`.

> Would `layouts/page/single.html` also inherit from `layouts/_default/baseof.html`?

Yes!

> Or do I need a separate baseof.html for each subdirectory like page/, categories/, etc for taxonomies under layouts/?

Nope.
