# Can't iterate over a list of .Params trying to make thumbnails for posts

**URL:** <https://discourse.gohugo.io/t/cant-iterate-over-a-list-of-params-trying-to-make-thumbnails-for-posts/38531>\
**Category:** support\
**Created:** [May 9, 2022, 8:38pm UTC](https://discourse.gohugo.io/t/cant-iterate-over-a-list-of-params-trying-to-make-thumbnails-for-posts/38531 "2022-05-09T20:38:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![osterchrisi](https://avatars.discourse-cdn.com/v4/letter/o/7cd45c/32.png) [@osterchrisi](https://discourse.gohugo.io/u/osterchrisi)\
**Post date:** [May 9, 2022, 8:38pm UTC](https://discourse.gohugo.io/t/cant-iterate-over-a-list-of-params-trying-to-make-thumbnails-for-posts/38531/1 "2022-05-09T20:38:59Z")

</div>

I have the following list.html (list of all my pages):

```auto
{{ define "main" }}
    <main class="posts">
        <h1>{{ .Title }}</h1>

        {{- if .Content }}
            <div class="content">{{ .Content }}</div>
        {{- end }}

        {{- range .Data.Pages.GroupByDate "2006" }}
            <div class="posts-group">
                <div class="post-year">{{ .Key }}</div>

                <ul class="posts-list">
                    {{- range .Pages }}
                        <li class="post-item">
                            <a href="{{.Permalink}}">
                                {{- $image := resources.Get .Params.featured_image -}}
                                {{ printf "%#v" $image }}
                                {{with $image}}
                                <img src="{{ ($image.Fill "200x200 q100 Center").RelPermalink }}">
                                {{end}}
                                <span class="post-title">{{.Title}}</span>
                                <!-- Removing this so the date doesn't render 
                                <span class="post-day">{{ if .Site.Params.dateformShort }}{{ .Date.Format .Site.Params.dateformShort }}{{ else }}{{ .Date.Format "Jan 2"}}{{ end }}</span>
                                -->
                            </a>
                        </li>
                    {{- end }}
                </ul>
            </div>
        {{- end }}
    </main>
{{ end }}

```

In the `<li class="post-item">` section I want to print small thumbnails but it gives me a `<nil>` pointer for every item on the list. I have added a

```auto
featured_image: "/media/test.png"

```

in all my markdown files. I don’t understand what I am doing wrong… I have stored the test image in the /content/media folder - or is that wrong? Please help me, thanks!

---

<div class="post-metadata">

**Author:** ![osterchrisi](https://avatars.discourse-cdn.com/v4/letter/o/7cd45c/32.png) [@osterchrisi](https://discourse.gohugo.io/u/osterchrisi)\
**Post date:** [May 9, 2022, 9:25pm UTC](https://discourse.gohugo.io/t/cant-iterate-over-a-list-of-params-trying-to-make-thumbnails-for-posts/38531/2 "2022-05-09T21:25:15Z")

</div>

Oh, figured it out myself. Hugo is looking in the assets folder of the theme when calling `resources.Get`. I put a symbolic link to my actual media folder there and now all is jolly!

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [May 11, 2022, 9:25pm UTC](https://discourse.gohugo.io/t/cant-iterate-over-a-list-of-params-trying-to-make-thumbnails-for-posts/38531/3 "2022-05-11T21:25:21Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
