# Multilingual range of content

**URL:** <https://discourse.gohugo.io/t/multilingual-range-of-content/57602>\
**Category:** support\
**Created:** [September 28, 2026, 5:13pm UTC](https://discourse.gohugo.io/t/multilingual-range-of-content/57602 "2026-09-28T17:13:03Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![malde11](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@malde11](https://discourse.gohugo.io/u/malde11)\
**Post date:** [September 28, 2026, 5:13pm UTC](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/1 "2026-09-28T17:13:03Z")

</div>

Hi,

I want a list.html for the fotos folder and then a single template for the countries. If I understand it right.

I get the following error:

```apl
render: [de v1.0.0 guest] failed to render pages: render of "D:/Code/example_2027/content/de/fotos/_index.md" failed: "D:\Code\example_2027\layouts\fotos\list.html:9:17": execute of template failed at <.thumb>: can’t evaluate field thumb in type page.Page

```

My list.html:

```auto
{{ define "header" }}
<h1 class="main-headline">{{ .Title }}</h1>
{{ end }}

{{ define "main" }}
{{ range .Pages }}
<a href="{{ .Permalink }}">
    <img src="{{ .thumb }}" width="360" height="260" alt="{{ .caption }}" class="galleryimage cursor" data-image="{{ .image }}">
</a>
{{ end }}
{{ end }}

```

My \_index.md:

```auto
+++

draft = false

title = 'Fotos'

description = 'Fotos aufgenommen von M.'

[params.gallery.deutschland]

headline = "Germany"

gallery_section = "deutschland_section"

[[params.gallery.deutschland.images]]

    caption = "Germany - Foto #1"

    thumb = "/images/photos/deutschland/deutschland-01-thumb.webp"

    image = "/images/photos/deutschland/deutschland-01.webp"

    id = "deutschland_Photo_1"

    url = '/fotos/germany'

+++

{{< gallery "deutschland" >}}

```

My folder structure:

 ![Screenshot 2026-09-28 184316](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/8/3/831bc5d58d472657ed86bc34c90c5e029b7044a2.png)

I want something like: [https://example.com/de/fotos/germany](https://example.com/de/fotos/germany)

Hard to explain.. I am not a native speaker sorry 🙂

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [September 28, 2026, 7:05pm UTC](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/2 "2026-09-28T19:05:01Z")

</div>

Hard to get something to recommend, if you cannot describe what you want.  
maybe visualize how the result should look like on these pages.

So before I recommend anything I do not understand how your \_index.md and the COUNTRY.md’s relate together.

maybe these questions could help you to formulate or visualize your requirements.

what should be displayed on the \_index page:

- a list of countries each represented by maybe
  - a headline, one teaser image,
  - a link to the actual gallery for that country.

or

- all images of all countries

or is it just one page showing all images?

what should be on each of the country.md files?

- all the images for a country ?
- any additional info for each image

or

- is that not related to your issue and something different

where are the fotos of each country?

do you want to automatically list all images or manually maintain which images , order, …

and whats that shortcode?

btw you code ranges over pages and the params are on the list page so `$.Params.gallery.deutschland.thumb` should work … but I guess that’s not really what you want (see above) 😉

and see below the list of related pages to your issue

---

<div class="post-metadata">

**Author:** ![malde11](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@malde11](https://discourse.gohugo.io/u/malde11)\
**Post date:** [September 28, 2026, 7:25pm UTC](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/3 "2026-09-28T19:25:44Z")

</div>

The first of your options is right.

In the \_index.md file I want _one image_ from every country and if I click on it then go to all images of that country. My images are stored in the static folder and I want to choose the order of the images.

That is what I have in germany.md:

```auto
+++
draft = false
title = 'Fotos Deutschland'
description = 'Fotos aufgenommen in Deutschland von M.'

[params.gallery.deutschland]
headline = "Germany"
gallery_section = "deutschland_section"

[[params.gallery.deutschland.images]]
caption = "Germany - Foto #1"
thumb = "/images/photos/deutschland/deutschland-01-thumb.webp"
image = "/images/photos/deutschland/deutschland-01.webp"
id = "deutschland_Photo_1"

[[params.gallery.deutschland.images]]
caption = "Germany - Foto #2"
thumb = "/images/photos/deutschland/deutschland-02-thumb.webp"
image = "/images/photos/deutschland/deutschland-02.webp"
id = "deutschland_Photo_2"

[[params.gallery.deutschland.images]]
caption = "Germany - Foto #3"
thumb = "/images/photos/deutschland/deutschland-03-thumb.webp"
image = "/images/photos/deutschland/deutschland-03.webp"
id = "deutschland_Photo_3"
+++

{{< gallery "deutschland" >}}
{{< modal >}}

```

and that is what my \_index.md look like:

```auto
+++
draft = false
title = 'Fotos'
description = 'Fotos aufgenommen von M.'

[params.gallery.deutschland]
headline = "Germany"
gallery_section = "deutschland_section"

[[params.gallery.deutschland.images]]
    caption = "Germany - Foto #1"
    thumb = "/images/photos/deutschland/deutschland-01-thumb.webp"
    image = "/images/photos/deutschland/deutschland-01.webp"
    id = "deutschland_Photo_1"

[params.gallery.niederlande]
headline = "Netherlands"
gallery_section = "niederlande_section"

[[params.gallery.niederlande.images]]
    caption = "Netherlands - Foto #1"
    thumb = "/images/photos/niederlande/niederlande-01-thumb.webp"
    image = "/images/photos/niederlande/niederlande-01.webp"
    id = "niederlande_Photo_1"

[params.gallery.daenemark]
headline = "Denmark"
gallery_section = "daenemark_section"

[[params.gallery.daenemark.images]]
    caption = "Denmark - Foto #1"
    thumb = "/images/photos/daenemark/daenemark-01-thumb.webp"
    image = "/images/photos/daenemark/daenemark-01.webp"
    id = "daenemark_Photo_1"

+++

{{< gallery "deutschland" >}}
{{< gallery "niederlande" >}}
{{< gallery "daenemark" >}}

```

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [September 28, 2026, 8:19pm UTC](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/4 "2026-09-28T20:19:09Z")

</div>

mmh, if it were mine I would go with layouts instead of shortcodes.

> code Updated to match [Multilingual range of content - #6 by irkode](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/6)

if you need additional stuff between the galleries than code put the code in shortcoddes.

the gist is - move all of the country properties to the gallery itself for a single point of true

changes to germany only need to be done in one file. and will be pulled in by the main \_index automatically

something like:

##### \_index.md

```auto
+++
draft = false
title = 'Fotos'
description = 'Fotos aufgenommen von M.'
+++

```

##### layout for \_index.md

```auto
{{/* maybe use .ByWeight (define on the pages) , maybe sort alphabetical or a simple list for full control*/}}
{{ range .Pages }}

  {{/* all attributes defined on the country page */}}

  <h2>{{.Params.Headline}}</h2>
  
   {{ with index .Params.gallery (sub .Params.teaserImage 1) }}
    THUMB: {{ .thumb }}
    IMAGE: {{ .image }}
  {{ end }}
    <a href={{.RelPermalink}}>See all of ...</a>
{{ end }}

```

##### germany/index.md

```auto
+++
title = 'Fotos Deutschland'
description = 'Fotos aufgenommen in Deutschland von M.'

[params]
headline = "Germany"
teaserImage = 1

[[params.gallery]]
caption = "Germany - Foto #1"
thumb = "/images/photos/deutschland/deutschland-01-thumb.webp"
image = "/images/photos/deutschland/deutschland-01.webp"
id = "deutschland_Photo_1"

[[params.gallery]]
caption = "Germany - Foto #2"
thumb = "/images/photos/deutschland/deutschland-02-thumb.webp"
image = "/images/photos/deutschland/deutschland-02.webp"
id = "deutschland_Photo_2"

[[params.gallery]]
caption = "Germany - Foto #3"
thumb = "/images/photos/deutschland/deutschland-03-thumb.webp"
image = "/images/photos/deutschland/deutschland-03.webp"
id = "deutschland_Photo_3"
+++

```

#### layout for germany/index.md

```auto
<h2>{{ .Title }}</h2>
{{ range .Params.gallery }}
  caption: {{ .caption }}
 ...
{{ end }}

```

if your images really follow these naming convention , you already have an order and can completely automate these.  
I would move or mount the images to assets (or the country folder as page resource, to use [rR]esources.get “images/germany/\*.webp” (if your images sort order is the display order.

completely untested just an idea: but for the definition in frontmatter have a look at [resources metadata in frontmatter](https://gohugo.io/content-management/page-resources/#resources-metadata-example)  
where you can map page resourcses to names/and attributes

maybe of target … missing lot of context with your actual intention 😉

---

<div class="post-metadata">

**Author:** ![malde11](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@malde11](https://discourse.gohugo.io/u/malde11)\
**Post date:** [September 29, 2026, 3:06pm UTC](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/5 "2026-09-29T15:06:17Z")

</div>

Thanks so far..

I can see all image if I visit: [https://example.com/fotos/germany](https://example.com/fotos/germany) that is nice 🙂

RelPermalink works also, but headline and thumb do not.

On the fotos/list.html I get this error:

> execute of template failed at \<.Headline\>: can’t evaluate field Headline in type page.Page

This is what my fotos/list.html looks like:

```auto
{{ define "header" }}

<h1 class="main-headline">{{ .Title }}</h1>

{{ end }}

{{ define "main" }}

{{ range .Pages }}

    <h2>{{ .Headline }}</h2>

    <img src="{{ .thumb }}">

    <a href="{{ .RelPermalink }}">See all of ...</a>

{{ end }}

{{ end }}

```

my \_index.md:

```auto
+++

draft = false

title = 'Fotos'

description = 'Fotos aufgenommen von M.'

+++

```

I guess, that is because in my \_index.md file I do not have a headline. But how can I access or get this in my fotos/list.html?

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [September 29, 2026, 3:58pm UTC](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/6 "2026-09-29T15:58:47Z")

</div>

oh. sry.

should be under

```auto
[params]
headline = "Germany"

```

in the country front matter

and accessed with `{{.Params.Headline }}` in both partials.

same for the teaserImage

to access the gallery entries from within the `range` inside the main index file use `.Params.gallery` use `index` for individual images and then access the fields.

> code updated in [Multilingual range of content - #4 by irkode](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/4)

---

<div class="post-metadata">

**Author:** ![malde11](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@malde11](https://discourse.gohugo.io/u/malde11)\
**Post date:** [September 29, 2026, 4:45pm UTC](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/7 "2026-09-29T16:45:17Z")

</div>

ahh.. I get another error now 😜

> executing “main” at \<.Params.gallery.image\>: can’t evaluate field image in type interface {}

My code:

```auto
{{ define "header" }}
<h1 class="main-headline">{{ .Title }}</h1>
{{ end }}

{{ define "main" }}
{{ range .Pages }}

    <h2>{{ .Params.Headline }}</h2>

    <img src="{{ .Params.gallery.image }}">

    <a href="{{ .RelPermalink }}">See all of ...</a>

{{ end }}
{{ end }}

```

and If I switch to English the content(images) are not there..

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [September 29, 2026, 5:21pm UTC](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/8 "2026-09-29T17:21:24Z")

</div>

> [@irkode](#):
>
> to access the gallery entries from within the `range` inside the main index file use `.Params.gallery` use `index` for individual images and then access the fields.

c’mon @malde11 you are not a fresher so I thought that one would do 😉 **especially** as I wrote I have updated the code.

Blindly copying some snippets to yours is mostly not a good idea.

have a look at the complete picture of my post above

- one list page / one gallery example page
- two layouts.

check out the front matter and how it relates to the code

hint: [[params.gallery]] is a slice of maps (you set it up)

I leave it up to you why there’s a `sub` statement in my code

* * *

regarding missing english. Check if all is really set up as for the german page. without having the source no way.

and again if one is working I thought you are able to duplicate. if not show your code (gallery + pages)

HINT: code defensive. The shown code works, but is for the _gist_ not a – production ready – fail safe – theme layout code. No error/empty checking at all

---

<div class="post-metadata">

**Author:** ![malde11](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@malde11](https://discourse.gohugo.io/u/malde11)\
**Post date:** [September 29, 2026, 5:27pm UTC](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/9 "2026-09-29T17:27:54Z")

</div>

Sorry.. I got it:

```auto
{{ define "main" }}

{{ range .Pages }}

    <h2>{{ .Params.Headline }}</h2>
    <a href="{{ .RelPermalink }}">
        <img src="{{ .Params.TeaserImage }}">
    </a>
    <a href="{{ .RelPermalink }}">See all of ...</a>
{{ end }}
{{ end }}

```

only the English part is missing.. 😛

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [September 29, 2026, 5:30pm UTC](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/10 "2026-09-29T17:30:31Z")

</div>

> [@malde11](#):
>
> `<img src="{{ .Params.TeaserImage }}">`

not really 😉 the teaser image in my example is just the number of the image to use on the gallery list.

---

<div class="post-metadata">

**Author:** ![malde11](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@malde11](https://discourse.gohugo.io/u/malde11)\
**Post date:** [September 29, 2026, 5:49pm UTC](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/11 "2026-09-29T17:49:40Z")

</div>

I have given the teaser a string/path to the image. For example:

teaserImage = “/images/photos/deutschland/deutschland-01-thumb.webp”.

And for the English version I have got a \_shortcode, but I do not understand all of them:

```auto
{{/*

Renders the content of the current page's translation in the specified language.
@param {string} The language key of site from which to retrieve the translation.
@returns {template.HTML}
@example {{< content de >}}
*/}}

{{ with $sourceLanguage := .Get 0 }}
  {{ if eq $.Page.Language.Lang $sourceLanguage }}
    {{ errorf "The positional parameter passed to the %q shortcode must not be the language key of the current site. See %s" $.Name $.Position }}
  {{ else }}
    {{ with index (where $.Page.Translations "Language.Lang" $sourceLanguage) 0 }}
      {{ .Content }}
    {{ else }}
      {{ errorf "The %q shortcode was unable to find a %q translation of the %q page. See %s" $.Name $sourceLanguage $.Page.Path $.Position }}
    {{ end }}
  {{ end }}
{{ else }}
  {{ errorf "The %q shortcode requires a positional parameter indicating the source language key. See %s" $.Name $.Position }}
{{ end }}

```

I understand that if I write: {{\< content de \>}} to an English markdown file, he will take the content from the German version. So both have the same content.

Here is an example of the English \_index.md:

```auto
+++

draft = false
title = 'Photos'
url = 'photos'
description = 'Photos taken by M.'
+++

{{< content de >}}

```

But somehow it is not working for the fotos folder.

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [September 29, 2026, 5:57pm UTC](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/12 "2026-09-29T17:57:14Z")

</div>

i used the position to not have to duplicate the path and full access to all the params for that image… question of maintainability.

the code looks like something for a multi language site. you never mentioned and no sign in your examples that germany is more than the location where the picture was taken…

so without real multi lang setup that is not the code you are looking for

---

<div class="post-metadata">

**Author:** ![malde11](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@malde11](https://discourse.gohugo.io/u/malde11)\
**Post date:** [September 29, 2026, 6:23pm UTC](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/13 "2026-09-29T18:23:30Z")

</div>

hmm.. the title of this post 😅

But it is OK.. I do not need everything translated. Only the links and urls would be fine.

That is my folder structure:

 ![Screenshot 2026-09-29 201628](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/c/4/c4e7d9a68029294623e39ce1fc5806b99f3be38c.png)

Everything is working but not the pages in the english folder(fotos).

```auto
+++
draft = false
title = 'Photos Denmark'
url = 'photos/denmark'
description = 'Photos taken in Denmark by M.'
+++

{{< content de >}}

```

This is an example of the daenemark.md from the English folder.. the title is displayed but not the content.

 ![Screenshot 2026-09-29 203232](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/1/d/1d37cef9304cfc23ae89017f08b1e6edffe6fb83.png)

The source of the image is empty..

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [September 29, 2026, 7:18pm UTC](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/14 "2026-09-29T19:18:22Z")

</div>

you are right, missed the “en” in the first folder structure 😊

> educated guess looks like you reorganized the range/with/ order?

 

your code, setup, frontmatter shortcodes all contribute to the final result. Sry but that’s too much moving factors for me over the chat. And your code may be based on mine but there are at least subtil differences…

 

Trying to replicate yours is not an option. Please share your repo (privately if you want).

 

need to stop guessing around to assist.

 
* * *
 

p.s. with that setup moving the country gallery array to a data file or page resource might be a good option.

 
- central source `data/gallery/country.[json|yaml]
- just pages to render - no need to “copy content”
- allows (easier) translation the country pages

 

moving/mounting images to headless fotos might also be a design possibility (allow for using getResource and the embedded render hook (also without image duplication)

---

<div class="post-metadata">

**Author:** ![malde11](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@malde11](https://discourse.gohugo.io/u/malde11)\
**Post date:** [September 29, 2026, 7:46pm UTC](https://discourse.gohugo.io/t/multilingual-range-of-content/57602/15 "2026-09-29T19:46:02Z")

</div>

OK.. I am on bitbucket.

Never shared or worked together with git in a team. I will try to invite you to my repo tomorrow. If you got time..
