Drupal is a registered trademark of Dries Buytaert
Release: Leaflet 10.4.11 Minor update available for module leaflet (10.4.11). Release: Session Inspector 1.0.8 Minor update available for module session_inspector (1.0.8). Release: Migrate QA 2.0.4 Minor update available for module migrate_qa (2.0.4). Release: CKEditor Description List 3.0.0 Major update available for module ckeditor_descriptionlist (3.0.0). Release: FlowDrop 2.4.0 Minor update available for module flowdrop (2.4.0). Release: JWT Token Refresh 1.0.4 Minor update available for module jwt_token_refresh (1.0.4). Release: ConReg 1.0.0-beta1 First beta version released for module conreg (1.0.0-beta1). Release: AI Image Studio 1.0.0-beta8 New beta version released for module ai_image_studio (1.0.0-beta8). Usage Milestone: Role Theme Switcher Module role_theme_switcher crossed 1,000 active installs. Module Revived: Decoupled Router 2.0.7 Module decoupled_router updated after 11 months of inactivity (2.0.7).

Advanced Text Formatter

9,092 sites Security covered
View on drupal.org

This module provides a simple way to format and display text fields on your website, compatible with other Drupal modules and view modes. It offers options to trim text, add ellipses, control word boundaries, and apply token replacement and filtering.

This module is just a formatter (display) of textfield, text area and text format. The idea behind this is to provide a simple solution, easy to setup, with few dependencies to display text on website.

Implementation

The trim function in this module is taken from Views module with a few modifications.

Integration

Of course, this module is fully compatible with any modules that use entity formatters, such as Views or Panels

Besides that, this module is extremely useful when you use it with view modes. In order to create a new view mode, you can implement the hook_entity_info_alter() or install Entity view modes module.

Dependencies

  1. Text (Drupal 7.x Core)
  2. Filter (Drupal 7.x Core)

Installation

Download the module and simply copy it into your contributed modules folder:
[for example, your_drupal_path/sites/all/modules] and enable it from the modules administration/management page.
More information at: Installing contributed modules (Drupal 7)

Configuration

After successful installation, browse to the "Manage Display" settings page, for the entity (Node content type, for example) with a text field, text area or text format, choose Advanced Text from the formatters list.

Options:

  • Trim length: The maximum number of characters the a field can be. Set this to 0 if you don't want to cut the text. Otherwise, input a positive integer.
  • Ellipsis: If checked, a "..." will be added if a field was trimmed.
  • Word Boundary: If checked, this field be trimmed only on a word boundary. This is guaranteed to be the maximum characters stated or less. If there are no word boundaries this could trim a field to nothing.
  • Token Replace: Run token replace on this field.
  • Filter: Filter the value of this field.
    • None: No filter.
    • Selected Text Format: Use the format that is chosen by user when he inputs the value.
    • Limit allowed HTML tags: A list of HTML tags that can be used.
    • Drupal: Filter this field by using Drupal's filters.
  • Allowed HTML tags (when Filter is Limit allowed HTML tags): Specify tags which should not be stripped.
  • Format (when Filter is Drupal): Drupal's filters.
  • Convert line breaks into HTML: Converts line breaks into <p> and <br> in an intelligent fashion.

Optional

If you want to display the list of available tokens, you just need to install Token module, then go to Manage Fields page, edit the field, and select the "Show available tokens in field's description" (see the 4th and 5th screenshot)

Known issues

Since 7.x-1.4, you will be able to insert token to a CKEditor 3.5+ AND TinyMCE 3.x editor (by clicking on the token as usual).
For other WYSIWYG editors, I don't have much time to work on and I'm very appreciated if someone can help me for adding support for those editors.

But please remember that you still can copy the token and paste into your editor.

Activity

Tracked releases
2
Tracked since
Jun 2026
Latest release
1 month ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
4.0.x-dev Dev Jun 29, 2026
3.0.x-dev Dev Jun 26, 2026