# Use custom page param inside .Paginator.Pages

**URL:** <https://discourse.gohugo.io/t/use-custom-page-param-inside-paginator-pages/23914>\
**Category:** support\
**Tags:** pagination\
**Created:** [March 10, 2020, 9:18pm UTC](https://discourse.gohugo.io/t/use-custom-page-param-inside-paginator-pages/23914 "2020-03-10T21:18:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdeshors](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gdeshors/32/10554_2.png) [@gdeshors](https://discourse.gohugo.io/u/gdeshors)\
**Post date:** [March 10, 2020, 9:18pm UTC](https://discourse.gohugo.io/t/use-custom-page-param-inside-paginator-pages/23914/1 "2020-03-10T21:18:00Z")

</div>

Hi

I’m facing an issue on which I need help. My post markdown is as follows :

```auto
---
title: "Announcing a great conference"
eventdate: '2020-03-12'
date: '2020-02-21'
tags:
- conference
- culture
- society
---

```

Now, I can use **.Params.eventdate** in, say header.html, it works OK.

What does NOT work is in list.html :

```auto
        <div class="posts-list">
          {{ range .Paginator.Pages }}
            <article class="post-preview">
              <a href="{{ .Permalink }}">
                <h2 class="post-title">{{ .Title }}</h2>
    
                {{ if .Params.subtitle }}
                  <h3 class="post-subtitle">
                    {{ .Params.subtitle }}
                  </h3>
                {{ end }}
              </a>
              <p>
                {{ if .Params.eventdate }}
                  ***THIS PART SHOULD DISPLAY BUT DOES NOT***
                {{ end }}
              </p>
              [...]
            </article>
          {{ end }}
        </div>

```

If I replace .Params.eventdate with .Params.subtitle, .Params.tags, .Params.title… all these work OK. So why doesn’t my eventdate work ? I think it’s related to being inside of the `{{ range .Paginator.Pages }}`, but I may be wrong.

Thanks for any help on getting this working !

```auto
-> hugo env
Hugo Static Site Generator v0.66.0/extended linux/amd64 BuildDate: unknown
GOOS=“linux”
GOARCH=“amd64”
GOVERSION=“go1.14”

```

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [March 11, 2020, 5:03am UTC](https://discourse.gohugo.io/t/use-custom-page-param-inside-paginator-pages/23914/2 "2020-03-11T05:03:14Z")

</div>

> [@gdeshors](#):
>
> So why doesn’t my eventdate work ?

I don’t know, I can’t see your code. Share it, for great support! 🕶

---

<div class="post-metadata">

**Author:** ![benmarte](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/benmarte/32/5948_2.png) [@benmarte](https://discourse.gohugo.io/u/benmarte)\
**Post date:** [March 11, 2020, 11:51am UTC](https://discourse.gohugo.io/t/use-custom-page-param-inside-paginator-pages/23914/3 "2020-03-11T11:51:15Z")

</div>

There are examples in the docs on how to do this: [https://gohugo.io/functions/isset/](https://gohugo.io/functions/isset/)

Also for better assistance post a link to your repo next time, which is what @maiki is referring to 🙂

---

<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:** [March 11, 2020, 12:25pm UTC](https://discourse.gohugo.io/t/use-custom-page-param-inside-paginator-pages/23914/4 "2020-03-11T12:25:32Z")

</div>

```auto
  {{ if .Params.eventdate }}
                  ***THIS PART SHOULD DISPLAY BUT DOES NOT***
    {{ end }}

```

The only reason I see that the above should not show is that the param `eventdate` isn’t set on that page.

A related tip would be to drop the quotes around the dates to get proper Go dates.

---

<div class="post-metadata">

**Author:** ![gdeshors](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gdeshors/32/10554_2.png) [@gdeshors](https://discourse.gohugo.io/u/gdeshors)\
**Post date:** [March 13, 2020, 7:07pm UTC](https://discourse.gohugo.io/t/use-custom-page-param-inside-paginator-pages/23914/5 "2020-03-13T19:07:19Z")

</div>

Thanks for your replies. My repository was private but after all I see no reason not to open it, after all it is a public website.

Here it is, on line 43 : [https://gitlab.com/guillaume.deshors/magnyethique.org/-/blob/eventdate/themes/beautifulhugo/layouts/\_default/list.html](https://gitlab.com/guillaume.deshors/magnyethique.org/-/blob/eventdate/themes/beautifulhugo/layouts/_default/list.html)  
If someone ever clones it be sure to checkout branch ‘eventdate’.

To reproduce, please go to [http://localhost:1313/post/](http://localhost:1313/post/) and check that the words ‘NE MARCHE PAS’ aren’t displayed on the first post as I want them to be.

And to verify that eventdate really is set on that page, go to [http://localhost:1313/post/2020-02-21-conference-gesticulee/](http://localhost:1313/post/2020-02-21-conference-gesticulee/) and check that the word ‘TEMPORAIRE’ appears in the title (as coded line 68 of [this file](https://gitlab.com/guillaume.deshors/magnyethique.org/-/blob/eventdate/themes/beautifulhugo/layouts/partials/header.html))

No progress on my side…
