# How to \`GetPage\` a specific file? (Multilingual mode)

**URL:** <https://discourse.gohugo.io/t/how-to-getpage-a-specific-file-multilingual-mode/17292>\
**Category:** support\
**Created:** [February 28, 2019, 2:42pm UTC](https://discourse.gohugo.io/t/how-to-getpage-a-specific-file-multilingual-mode/17292 "2019-02-28T14:42:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jura](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jura/32/13581_2.png) [@Jura](https://discourse.gohugo.io/u/Jura)\
**Post date:** [February 28, 2019, 2:42pm UTC](https://discourse.gohugo.io/t/how-to-getpage-a-specific-file-multilingual-mode/17292/1 "2019-02-28T14:42:04Z")

</div>

In my front matter files I define custom information. I want to keep that information management easy by not replicating that information in each translated language.

My idea was to do:

```auto
{{ $person := .Site.GetPage (print "/en/about/" .File.LogicalName) }}
First name of person: {{ $person.Params.firstName }}

```

This, unfortunately, doesn’t work:

> Failed to render pages: render of “page” failed: “C:\Temp\site\themes\theme2019\layouts\custom\person.html:1:1”: execute of template failed: panic in Execute: runtime error: invalid memory address or nil pointer dereference. See “[Method invoke in templates panics if the receiver is nil · Issue #5327 · gohugoio/hugo · GitHub](https://github.com/gohugoio/hugo/issues/5327)” for the reason why we cannot provide a better error message for this.

`GetPage` seems to default to the current language, since this works fine:

```auto
{{ $person := .Site.GetPage (print "/about/" .File.LogicalName) }}
First name of person: {{ $person.Params.firstName }}

```

But then I still have to replicate the front matter in each content file. It would be easier to have the English Markdown file serve as ‘master’, and each language pull the front matter from that file.

Can I achieve such a thing with Hugo?

* * *

I prefer using the front matter instead of data files in this case, since the front matter information is specific to the page (but not specific to the language).

* * *

Language settings:

```auto
defaultContentLanguage = "nl"
defaultContentLanguageInSubDir = true

[nl]
    contentDir = "content/nl"
        
[en]
    contentDir = "content/en"

(etc for other languages)

```

```auto
Hugo Static Site Generator v0.54.0/extended windows/amd64 BuildDate: unknown

```

---

<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:** [February 28, 2019, 3:18pm UTC](https://discourse.gohugo.io/t/how-to-getpage-a-specific-file-multilingual-mode/17292/2 "2019-02-28T15:18:20Z")

</div>

See this previous thread, it may help

> [@Fetch page from another language using .GetPage](https://discourse.gohugo.io/t/fetch-page-from-another-language-using-getpage/16087):
>
> I’m trying to get the home page from another language than the current one from the template with .GetPage to no avail. I guess what I need is the equivalent of {{\< relref path="document.md" lang="ja" \>}} but for .Site.GetPage. I could not find which string to pass as .GetPage parameter to get what I want frowning

---

<div class="post-metadata">

**Author:** ![Jura](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jura/32/13581_2.png) [@Jura](https://discourse.gohugo.io/u/Jura)\
**Post date:** [February 28, 2019, 3:47pm UTC](https://discourse.gohugo.io/t/how-to-getpage-a-specific-file-multilingual-mode/17292/3 "2019-02-28T15:47:11Z")

</div>

Thanks for the quick reply and finding that thread. 🙂

I’ve fixed my problem, and this is the code I ended up using:

```auto
{{ $en := index (where .Sites "Language.Lang" "en") 0 }}

{{ $person := $en.GetPage (print "/about/" .File.LogicalName) }}

```
