Redactor pagebreak plugin and linking to pages I am trying to split entry into multiple pages.

In accordance with the docs, I am using this code on single-entry template:

{{ entry.body.getPage(1) }}

{% if entry.body.getTotalPages() &gt; 1 %}
  &lt;a href="{{ entry.url }}"&gt;Continue reading…&lt;/a&gt;
{% endif %}


However {{ entry.url }} is always pointing to the same page that I'm on (base entry URL) without any pagination number, so I never get to second page.
I have checked that {{entry.body.getTotalPages()}} returns 2, so the pagebreak plugin is working.

What am I missing here?

Answer:

Here's the working code that I got with Brad Bell's help:

{% set currentPage = 1 %}
{% if craft.request.getParam('page') is not empty %}
    {% set currentPage = craft.request.getParam('page') %}
{% endif %}

{{ entry.body.getPage(currentPage) }}

{% if entry.body.getTotalPages() &gt; 1 %}
    {% set totalPages = entry.body.getTotalPages() %}

    {% for i in 1..totalPages %}
    &lt;a href="{{ url(entry.url, {page: i}) }}"&gt;go to page: {{ i }}&lt;/a&gt;
    {% endfor %}
{% endif %}
The example is the docs you're referring to will simple output the first "page" of the Rich Text field and if there are more pages show a "Continue Reading" link that loads the full entry.

For the functionality you're looking for you'd have to do something like this (completely untested):

{% set totalPages = entry.body.getTotalPages() %}

{% for i in 1..totalPages %}
    &lt;a href="{{ url(entry.url, {page: i}) }}"&gt;{{ i }}&lt;/a&gt;
{% endfor %}


Then your template would grab the page from the querystring and display it  using entry.body.getPage(page).