pixelcoda/typo3-text-flow

Optimizes text flow with dynamic hyphenation

Installs: 14

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:typo3-cms-extension

v1.0.19 2025-04-16 19:11 UTC

README

A powerful text optimization extension for TYPO3 that provides intelligent hyphenation and text flow enhancement.

Features

  • Multi-language support for text hyphenation
  • Smart pattern-based hyphenation algorithm
  • HTML content preservation
  • Case-sensitive text processing
  • Performance optimization through caching
  • Backend module for text optimization
  • Frontend plugin for automatic text processing
  • Configurable content element

Installation

Install via composer:

composer require pixelcoda/text-flow

Configuration

Basic Setup

  1. Install the extension through the Extension Manager
  2. Include the static TypoScript template
  3. Configure language settings in your site configuration

Content Element Settings

Configure the TextFlow content element in your page properties:

tt_content.text_flow {
    settings {
        enableTextFlow = 1
        defaultLanguage = en
    }
}

Usage

In Fluid Templates

Use the ViewHelper to process text:

{namespace tf=PixelCoda\TextFlow\ViewHelpers}

<tf:process text="{text}" />

In PHP

use PixelCoda\TextFlow\Service\TextFlowService;

$textFlowService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(TextFlowService::class);
$processedText = $textFlowService->hyphenate($text);

Content Element

  1. Create a new content element
  2. Select "TextFlow" from the content type list
  3. Enter your text
  4. Configure language and hyphenation settings

Pattern Management

Adding Custom Patterns

Create a pattern file in Configuration/Patterns/:

return [
    'pattern' => 'your-pattern',
    'language' => 'en',
    'priority' => 1
];

Pattern Format Rules

  • Use hyphens (-) to indicate possible break points
  • Patterns must be at least 2 characters long
  • Priority determines pattern application order

Development

Running Tests

composer test

Code Style

composer cs-fix

Troubleshooting

Common Issues

  1. No hyphenation visible:

    • Check if TextFlow is enabled in TypoScript
    • Verify language settings
    • Clear TYPO3 cache
  2. Pattern not working:

    • Check pattern format
    • Verify language assignment
    • Clear pattern cache

Logging

TextFlow logs important operations to TYPO3's system log. Check the log for:

  • Pattern loading issues
  • Language configuration problems
  • Processing errors

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

GPL-2.0-or-later. See LICENSE file for details.

Support