# List of pages by custom attributes (only for filtered images)

**URL:** <https://discourse.gohugo.io/t/list-of-pages-by-custom-attributes-only-for-filtered-images/23692>\
**Category:** support\
**Created:** [February 27, 2020, 12:43am UTC](https://discourse.gohugo.io/t/list-of-pages-by-custom-attributes-only-for-filtered-images/23692 "2020-02-27T00:43:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![noah-de](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/noah-de/32/10002_2.png) [@noah-de](https://discourse.gohugo.io/u/noah-de)\
**Post date:** [February 27, 2020, 12:43am UTC](https://discourse.gohugo.io/t/list-of-pages-by-custom-attributes-only-for-filtered-images/23692/1 "2020-02-27T00:43:44Z")

</div>

Greetings!  
After taking some time away from this project, I feel that we are ‘sooo close’ to the requirements for this simple website, but I am having trouble still (almost where I left off on the related issue: [Suggestions for content type](https://discourse.gohugo.io/t/suggestions-for-content-type/21923))

Utilizing the image processing features of making pages for each person seemed like the way to go.

**The goal:**

- Putting titles above the listed lab members in order: by association

The end result being something like this:

**Faculty**  
image image image  
name name name

**Post Docs**  
image image image  
name name name

**PhD Candidates**  
image image image  
name name name

**Emeriti**  
image image image  
name name name

Here are the associated bits of the hugo site that I have almost accomplished this with:

> <https://gist.github.com/noah-de/a97786c8884f2c82ad7559be73824319>

Setting aside ambitions for an elegant solution, I thought that this might be as simple as putting something like a series of _if statements_:

```
{{ if eq .Params.affiliation "Faculty" }}
<h2>Faculty</h2>
{{ end }}

```

to add titles between the photos (and associated names) that are already output in the correct order.

However this isn’t working.  
I have scoured the documentation on ordering lists and I have not been able to reach a point where I am able to craft the solution that I am after.

Seems like I need to grad the associations from the range of pages before I display the pages…

Any suggestions?

Could something like this be the correct way?

```
					<!-- Groups content according to content section.-->
				{{ range $s := .Data.Pages.GroupBy "Section" }}

```

> <https://gist.github.com/Xeoncross/203d8b1459463a153a3c734c98b342a9>

When I try to approach this method, I get the following error:

```
execute of template failed: template: members/list.html:8:20: executing 
"content" at <.Params.affiliation>: can't evaluate field Params in type page.PageGroup

```

I am having trouble understanding how to get ‘work’ done in hugo and I would appreciate all helpful suggestions.

Many thanks!

---

<div class="post-metadata">

**Author:** ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)\
**Post date:** [February 28, 2020, 5:23am UTC](https://discourse.gohugo.io/t/list-of-pages-by-custom-attributes-only-for-filtered-images/23692/2 "2020-02-28T05:23:03Z")

</div>

Hi there,

It would be easier to help you if you had a repo demonstrating your issue that we could easily clone, instead of trying to create one hoping to match your setup. Have a read here about [Requesting Help](https://discourse.gohugo.io/t/requesting-help/9132) .

---

<div class="post-metadata">

**Author:** ![noah-de](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/noah-de/32/10002_2.png) [@noah-de](https://discourse.gohugo.io/u/noah-de)\
**Post date:** [February 28, 2020, 6:14pm UTC](https://discourse.gohugo.io/t/list-of-pages-by-custom-attributes-only-for-filtered-images/23692/3 "2020-02-28T18:14:27Z")

</div>

Thank you for the reply!  
I kept reading other posts (and the docs) and was able to get to a very hack-ish solution.

I described it here: [Sort grouped and sorted content based on custom slice](https://discourse.gohugo.io/t/sort-grouped-and-sorted-content-based-on-custom-slice/16469/8)
