How to just get all items in a section?

I am making a site that has some locations. I want them all in a list at the bottom of every page. I tried using menus, but the menu item only really shows the name. I need access to all the original fields in the location record in order to generate the list in an attractive and readable manner showing the address, phone, etc. Is there any way to do this?

It seems bizarrely difficult and confusing to get access to arbitrary collections in hugo, or else it is just undocumented. (In middleman, would just do data.locations.each … in a partial for example)

Something like this:

{{ range where $.Site.Pages "Section" "post" }}
{{ .Title }}
{{ end

See https://gohugo.io/templates/functions#where

I haven’t looked closely into how Jekyll does this, but this is pretty powerful once you get the grips of it. And you can use it with paginators, too. Tell that to Jekyll …

Thanks, I couldn’t imagine that it didn’t exist, but it wasn’t on any of the documentation pages I was reading. I feel like it should get its own page, or mention should be made on the “List of Content” page.

How did you get the name of the collection though? I am really not sure how to differentiate between .Data.Pages, .Site.Pages, .Site.Data.Pages, and $.Site.Pages. It is a good thing you included that, because I would have been back with another question.

How I get them? I’m pretty sure I know the Hugo code base better than anyone else. But also means I don’t see the flaws in the documentation as clearly as others. A tip for you is to look at the many examples. There are lots of them linked to from the doc site, with source and all. Your main question here would have been clear if you looked at my main page template etc.