Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Field Longtext Pager

3 sites No security coverage
View on drupal.org

This module allows you to break down long text fields into multiple, easily navigable pages. It intelligently handles complex HTML and offers features like an index, estimated reading time, and smooth Ajax paging.

This module provides a field formatter for splitting large longtext field content into more readable, indexed sub-pages as defined by pagebreaks, or a specific number of characters, words, or HTML blocks.

It also provides additional optional display features:

  • Pager index field
  • Estimated reading time field
  • Ajax paging

Requirements

  • Drupal 10, 11, or 12.

Recommended Modules

Installation

  1. Install as you would normally install a contributed Drupal module.
    composer require drupal/field_longtext_pager

To set module default settings visit:
<YOUR-SITE-URL>/admin/config/content/field_longtext_pager

You must ensure that your text formats and editors allow your page break placeholder.

The default example is:

<!--pagebreak-->

There are CKEditor plugins available to enable manual pagebreak insertion.

To enable paging on your field, visit the "Manage display" options in your entity field settings:
/admin/structure/types/manage/<ENTITY-ID>/display

Select the "Field pager" format option and choose your desired settings.

Ajax pager results currently use the "Full page" view to return results, falling back to the "Default" view when not found, which is often the case with entities such as comments.

The pager IDs are automatically incremented from the setting defined in the field options when multiple entities using paged fields are displayed on the same page. Reserve your highest pager ID settings for your primary fields in this scenario.

Technical Description

The algorithms are designed to split complicated HTML markup smartly. For example, it safely takes this:

<div class="text-important">
  <p class="info">
  Long content paragraph... 
<!--pagebreak-->
  Continuation of long content paragraph.
  </p>
  <ul class="text-note">
    <li>List #1</li>
    <li>Long list #2...
<!--pagebreak-->
    Continuation of long list #2</li>
    <li>List #3</li>
  </ul>
</div>

And cleanly splits it into this:

<div class="text-important">
  <p class="info">
  Long content paragraph... 
  </p>
</div>
------------Page 1------------
<div class="text-important">
  <p class="info">
  Continuation of long content paragraph.
  </p>
  <ul class="text-note">
    <li>List #1</li>
    <li>Long list #2...</li>
  </ul>
</div>
------------Page 2------------
<div class="text-important">
  <ul class="text-note">
    <li>Continuation of long list #2</li>
    <li>List #3</li>
  </ul>
</div>
------------Page 3------------

Maintainers

  • Dan Greenman - Freelance full-stack developer for hire.
    dangreenman

Commission your wildest Open Source software dreams.
See: Portfolio

Support This Project

If you find this module useful and would like to support its continued development, please consider making a donation. Your contributions help cover server costs, fund new features, and allow me to dedicate more time to maintaining this open-source project.

Donations are accepted in the following cryptocurrencies:

Coin Network Address Bitcoin BTC Mainnet bc1qwtnf888phavjuulj5y6ryvcgpyscckzt5gfu5p Monero XMR Mainnet 44KTVNFzSmC12srxKgxvCEbmUXSzjNmT1NAHRpF9tuhvCDMpsimTZerAxPr4pNrtT7EjqN45WKerrAh1K9UgKayR9ogksYm ZCash ZEC Mainnet t1g1zSTxGBtQJcQtdum52tXd2bBp8WkrbkG

Note: Network fees may vary depending on the cryptocurrency and current network congestion. Please ensure your donation amount accounts for these fees to avoid delays or failed transactions.

Activity

Total releases
4
First release
Jun 2025
Latest release
2 weeks ago
Releases (12 mo)
2
Maintenance
Active

Release Timeline

Releases

Version Type Release date
2.1.1 Stable Jun 27, 2026
2.1.0 Stable Jun 23, 2026
2.0.x-dev Dev Jun 1, 2025
2.1.x-dev Dev Jun 1, 2025