$paginatorTitle := .Paginate - twice

Hello. I add code in header.html

			{{ $paginatorTitle := .Paginate (where (where .Site.RegularPages.ByDate.Reverse "Type" "blog") "Params.hide_public" false) }}
			{{ if (le 2 $paginatorTitle.PageNumber) }} - {{ T "Page_Number" }} {{ $paginatorTitle.PageNumber }}{{ end }}

And add the code in blog Section tpl.

			{{ $paginator:= .Paginate (where (where .Site.RegularPages.ByDate.Reverse "Type" "blog") "Params.hide_public" false) }}
					{{ range $k, $v := $paginator.Pages }}
					{{ .Render "blog_section.li" }}
					{{ end }}

The second condition doesn’t work. If I choose code to

		{{ $paginator:= .Paginate (where (where .Site.RegularPages.ByDate.Reverse "Type" "cases") "Params.hide_public" false) }}
				{{ range $k, $v := $paginator.Pages }}
				{{ .Render "blog_section.li" }}
				{{ end }}

I will see blog post, not cases. Why?
How do I override a variable?

The core of this is that there is only 1 paginated set for a given page, and it’s cached on first invocation.

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