# Page parameter as partial's name?

**URL:** <https://discourse.gohugo.io/t/page-parameter-as-partials-name/8114>\
**Category:** support\
**Created:** [August 25, 2017, 8:35am UTC](https://discourse.gohugo.io/t/page-parameter-as-partials-name/8114 "2017-08-25T08:35:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pogopaule](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pogopaule/32/3977_2.png) [@pogopaule](https://discourse.gohugo.io/u/pogopaule)\
**Post date:** [August 25, 2017, 8:35am UTC](https://discourse.gohugo.io/t/page-parameter-as-partials-name/8114/1 "2017-08-25T08:35:39Z")

</div>

I have a page parameter called `foo` with the value `bar.html`:

```auto
---
foo: "bar.html"
---

```

I would like to use this param to specify which partial to use. Is that possible in hugo? Something like this:

```auto
{{ partial .Params.foo . }}

```

The snippet above does not work since I get the following error:

```auto
Error while rendering "page": template bla/bla/bla/bla.html executing "main" at <.Params.foo>: invalid value; expected string

```

---

<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:** [August 25, 2017, 7:56pm UTC](https://discourse.gohugo.io/t/page-parameter-as-partials-name/8114/2 "2017-08-25T19:56:57Z")

</div>

Try to cast `foo` into a string:

```
{{ partial (string .Params.foo) . }}
```
