# Params in a partial

**URL:** <https://discourse.gohugo.io/t/params-in-a-partial/4378>\
**Category:** support\
**Created:** [October 23, 2016, 1:36pm UTC](https://discourse.gohugo.io/t/params-in-a-partial/4378 "2016-10-23T13:36:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![juh2](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/juh2/32/3980_2.png) [@juh2](https://discourse.gohugo.io/u/juh2)\
**Post date:** [October 23, 2016, 1:36pm UTC](https://discourse.gohugo.io/t/params-in-a-partial/4378/1 "2016-10-23T13:36:45Z")

</div>

Dear all,

I try to hugofy a theme from html5up.

I want to make the theme customizable via config.toml.

The theme has a frontpage with several entries that are set in config.toml. Everything works perfectly but in the sidebar nothing works. No values from config.toml are used. It seems that hugo simply does not work inside the sidebar.

So I am stuck.  
Here is my code:

[https://github.com/juh2/testsite/blob/master/config.toml](https://github.com/juh2/testsite/blob/master/config.toml)

Eg. the contact infos are not shown:

[https://github.com/juh2/testsite/blob/master/themes/hugo-editorial/layouts/partials/contact.html](https://github.com/juh2/testsite/blob/master/themes/hugo-editorial/layouts/partials/contact.html)

The whole site is here.  
[https://github.com/juh2/testsite](https://github.com/juh2/testsite)

If you start the site, you should see an open sidebar without any informations from config.toml. Informations on the main page are displayed.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [October 23, 2016, 1:56pm UTC](https://discourse.gohugo.io/t/params-in-a-partial/4378/2 "2016-10-23T13:56:10Z")

</div>

I haven’t looked at the code, but you need to pass the page (or whatever) context as the last argument to the partial.

---

<div class="post-metadata">

**Author:** ![juh2](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/juh2/32/3980_2.png) [@juh2](https://discourse.gohugo.io/u/juh2)\
**Post date:** [October 23, 2016, 2:14pm UTC](https://discourse.gohugo.io/t/params-in-a-partial/4378/3 "2016-10-23T14:14:30Z")

</div>

I don’t understand.

The same code is used in the main block defined in “index.html” and in a partial included by baseof.html.

In the baseofhtml-partial it does not work.

---

<div class="post-metadata">

**Author:** ![digitalcraftsman](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/digitalcraftsman/32/4142_2.png) [@digitalcraftsman](https://discourse.gohugo.io/u/digitalcraftsman)\
**Post date:** [October 23, 2016, 2:24pm UTC](https://discourse.gohugo.io/t/params-in-a-partial/4378/4 "2016-10-23T14:24:42Z")

</div>

What @bep means is that you have to pass the page context, the `.`, to the partials that you’re using. Only with the context you’re able to access variables from the config file etc.

When you include the `sidebar.html` partial in the [`baseof.html`](https://github.com/juh2/testsite/blob/master/themes/hugo-editorial/layouts/_default/baseof.html#L39) template you have to add the `.` as last argument.

```
{{ partial "sidebar.html" . }}

```

Inside the `sidebar.html` partial you nested further partials that actually require the information that you can access trough the context.

Therefore, you have to pass the context to each (sub-)partial in [`sidebar.html`](https://github.com/juh2/testsite/blob/master/themes/hugo-editorial/layouts/partials/sidebar.html#L5) as well, e.g.:

```
{{ partial "search.html" . }}
{{ partial "nav.html" . }}
...
```

---

<div class="post-metadata">

**Author:** ![juh2](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/juh2/32/3980_2.png) [@juh2](https://discourse.gohugo.io/u/juh2)\
**Post date:** [October 23, 2016, 3:00pm UTC](https://discourse.gohugo.io/t/params-in-a-partial/4378/5 "2016-10-23T15:00:15Z")

</div>

😲 These damn little dots.

Thanks  
juh

---

<div class="post-metadata">

**Author:** ![rdwatters](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rdwatters/32/2848_2.png) [@rdwatters](https://discourse.gohugo.io/u/rdwatters)\
**Post date:** [October 24, 2016, 3:25am UTC](https://discourse.gohugo.io/t/params-in-a-partial/4378/6 "2016-10-24T03:25:23Z")

</div>

@juh2 Which theme are you porting over?

---

<div class="post-metadata">

**Author:** ![juh2](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/juh2/32/3980_2.png) [@juh2](https://discourse.gohugo.io/u/juh2)\
**Post date:** [October 24, 2016, 5:37am UTC](https://discourse.gohugo.io/t/params-in-a-partial/4378/7 "2016-10-24T05:37:44Z")

</div>

@rdwatters The new editorial theme. [https://html5up.net/editorial](https://html5up.net/editorial)

---

<div class="post-metadata">

**Author:** ![rdwatters](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rdwatters/32/2848_2.png) [@rdwatters](https://discourse.gohugo.io/u/rdwatters)\
**Post date:** [October 24, 2016, 5:45pm UTC](https://discourse.gohugo.io/t/params-in-a-partial/4378/8 "2016-10-24T17:45:20Z")

</div>

@juh2 I just downloaded the editorial theme. Did the dot/context issue fix your question? If not, let me know and I can look at the code on the theme and will clone your repo. Thanks.

---

<div class="post-metadata">

**Author:** ![juh2](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/juh2/32/3980_2.png) [@juh2](https://discourse.gohugo.io/u/juh2)\
**Post date:** [October 24, 2016, 8:17pm UTC](https://discourse.gohugo.io/t/params-in-a-partial/4378/9 "2016-10-24T20:17:53Z")

</div>

Yes, it’s fixed.
