<p>I didn't know the that the Craft Redactor plugin had this method for pagebreaks, I don't think it was ever documented. In any case, this method apparently was implemented in the <a href="https://github.com/craftcms/redactor/blob/3.x/src/FieldData.php" rel="nofollow noreferrer"><code>FieldData</code> class</a> of the Craft Redactor plugin as a convenience method. However, the corresponding <a href="https://github.com/craftcms/ckeditor/blob/4.x/src/data/FieldData.php" rel="nofollow noreferrer"><code>FieldData</code> class in the CKEditor plugin does not have a similar method</a>. So it looks like this feature is not supported by the CKEditor plugin, and you will indeed have to implement it yourself.</p>
<p>You can take a look at the implementation of the Redactor class for inspiration. However, it looks like CKEditor stores page breaks in a different format than Redactor did, so keep that in mind.</p>

CC BY-SA 4.0
2024-12-22T15:53:47.893Z
2024-12-22T15:53:47.893Z
MoritzLost
<p>I moved a bunch of sites from Redactor to CKEditor and having issues with page breaks not working. This is the Twig code I used with Redactor:</p>
<pre><code>{{ entry.body.getPage(1) }}
</code></pre>
<p>That no longer works with CKEditor - using the code above it returns null. I tried deleting the original page break and adding a new one within CDEditor, but it still returns null.</p>
<p>I know I can use the 'split' filter to get 'page 1', but that seems like a step backwards from the more elegant approach of the past.</p>
<p>I cannot find anything in Craft docs or CKEditor docs that helps, so reaching out to you good folks for some advice!</p>

<ckeditor5>
Twig code for CKEditor page break
# Twig code for CKEditor page break

(Asked by: username_0 on 2024-12-20)

I moved a bunch of sites from Redactor to CKEditor and having issues with page breaks not working. This is the Twig code I used with Redactor:
{{ entry.body.getPage(1) }}

That no longer works with CKEditor - using the code above it returns null. I tried deleting the original page break and adding a new one within CDEditor, but it still returns null.
I know I can use the 'split' filter to get 'page 1', but that seems like a step backwards from the more elegant approach of the past.
I cannot find anything in Craft docs or CKEditor docs that helps, so reaching out to you good folks for some advice!

**Tags:** ckeditor5

---

## 1 answers

### Answer by username_1 on 2024-12-22. Score: 1

I didn't know the that the Craft Redactor plugin had this method for pagebreaks, I don't think it was ever documented. In any case, this method apparently was implemented in the [`FieldData` class](https://github.com/craftcms/redactor/blob/3.x/src/FieldData.php) of the Craft Redactor plugin as a convenience method. However, the corresponding [`FieldData` class in the CKEditor plugin does not have a similar method](https://github.com/craftcms/ckeditor/blob/4.x/src/data/FieldData.php). So it looks like this feature is not supported by the CKEditor plugin, and you will indeed have to implement it yourself.

You can take a look at the implementation of the Redactor class for inspiration. However, it looks like CKEditor stores page breaks in a different format than Redactor did, so keep that in mind.


---

