summaryrefslogtreecommitdiffstats
path: root/docs/content/en/methods/pager/TotalNumberOfElements.md
blob: ad29a01f378ad81c1896cab435349862e80b1bbb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
title: TotalNumberOfElements
description: Returns the number of pages in the pager collection.
categories: []
keywords: []
params:
  functions_and_methods:
    returnType: int
    signatures: [PAGER.TotalNumberOfElements]
---

```go-html-template
{{ $pages := where site.RegularPages "Type" "posts" }}
{{ $paginator := .Paginate $pages }}

{{ range $paginator.Pages }}
  <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ end }}

{{ with $paginator }}
  {{ .TotalNumberOfElements }}
{{ end }}
```