# Ignore / replace baseof.html for one template

**URL:** https://discourse.gohugo.io/t/ignore-replace-baseof-html-for-one-template/19217
**Category:** support
**Created:** [June 15, 2019, 10:40am UTC](https://discourse.gohugo.io/t/ignore-replace-baseof-html-for-one-template/19217 "2019-06-15T10:40:46Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![smth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/smth/32/7670_2.png) [@smth](https://discourse.gohugo.io/u/smth)
#### Post date: [June 15, 2019, 10:40am UTC](https://discourse.gohugo.io/t/ignore-replace-baseof-html-for-one-template/19217/1 "2019-06-15T10:40:46Z")

</div>

Is there any way you can tell a template not to inherit baseof.html?

Say you have your `_default`

- baseof
- list
- single

Then `section-one` inherits baseof and overrides:

- list
- single

Then say for `section-two` you want the single template to be completely different, and not include anything from baseof.

- list
- single \<- _skip baseof here_

I guess you could achieve this by checking whether you are on a single page in section-two in the baseof template, but wondering if its possible to achieve this from within the section template, i.e `/themes/<THEME>/layouts/section-two/single.html`

---

<div class="post-metadata">

### Author: ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)
#### Post date: [June 15, 2019, 11:55am UTC](https://discourse.gohugo.io/t/ignore-replace-baseof-html-for-one-template/19217/2 "2019-06-15T11:55:21Z")

</div>

Have a look at the section “base template lookup order” for this.

> **[Base Templates and Blocks](https://gohugo.io/templates/base/)**
>
> The base and block constructs allow you to define the outer shell of your master templates (i.e., the chrome of the page).

You probably need to create `baseof` in the section-two folder.

Other than that, a really hacky way would be to have a baseof template with only blocks and then overwrite the blocks you don’t like in single.html. an html comment would do the trick.

---

<div class="post-metadata">

### Author: ![smth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/smth/32/7670_2.png) [@smth](https://discourse.gohugo.io/u/smth)
#### Post date: [June 15, 2019, 12:11pm UTC](https://discourse.gohugo.io/t/ignore-replace-baseof-html-for-one-template/19217/3 "2019-06-15T12:11:23Z")

</div>

That would overwrite the `baseof` template for everything in section two though, right? I’m talking about doing it for an individual template (within that section). So as in the example above, for pages using the `single` template, but not those using the `list` template.

---

<div class="post-metadata">

### Author: ![ju52](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ju52/32/6749_2.png) [@ju52](https://discourse.gohugo.io/u/ju52)
#### Post date: [June 15, 2019, 12:33pm UTC](https://discourse.gohugo.io/t/ignore-replace-baseof-html-for-one-template/19217/4 "2019-06-15T12:33:45Z")

</div>

Change your baseof template, use anything like

```
{{if (eq .Type "section-two") }}
...
{{ end }}
```

---

<div class="post-metadata">

### Author: ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)
#### Post date: [June 15, 2019, 12:37pm UTC](https://discourse.gohugo.io/t/ignore-replace-baseof-html-for-one-template/19217/5 "2019-06-15T12:37:35Z")

</div>

Other templates do not inherit from baseof automatically. You have to write something like this to make the inheritance happen:

```
{{ define "main" }}

{{ end }}

```

So if you omit those bits from your template, it won’t inherit from baseof.

---

<div class="post-metadata">

### Author: ![smth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/smth/32/7670_2.png) [@smth](https://discourse.gohugo.io/u/smth)
#### Post date: [June 15, 2019, 1:50pm UTC](https://discourse.gohugo.io/t/ignore-replace-baseof-html-for-one-template/19217/6 "2019-06-15T13:50:40Z")

</div>

> [@zwbetz](#):
>
> Other templates do not inherit from baseof automatically. You have to write something like this to make the inheritance happen:
> 
> ```auto
> {{ define "main" }}
> 
> {{ end }}
> 
> ```

Ha, oh yeah! That’s the answer then 😁
