Pagination not working on term.html

Initially {{range .Pages}} works lovely and will iterate over each page available in the taxonomy term. But once pagination is added it breaks saying cannot iterate over nil. Any ideas? I’m sure the coffee has yet to kick in this morning.

I’ve tried the following bit from here: https://discourse.gohugo.io/t/pagination-inside-terms-page-issue/29431

As well as :

 {{len .Pages}}
  {{ $pager := .Paginate .Pages 2 }}
  {{$pager}} 

len turns up as 9 while $pager returns nil.

Cheers

layouts/_default/term.html

{{ range (.Paginate .Pages).Pages }}
  <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end }}
{{ template "_internal/pagination.html" . }}
1 Like

Legend. I also went back and it’s actually clear in the docs you needed to do this :frowning: Seriously, brain not working when reading the manual.

1 Like

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