blob: 3cd1c8dad42b0cbf3dabac2cea5ab04ecf66e83a (
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
24
25
|
---
title: TotalNumberOfElements
description: Returns the number of pages in the pager collection.
categories: []
keywords: []
action:
related:
- methods/pager/NumberOfElements
- methods/page/Paginate
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 }}
```
|