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
Requires
- typo3/cms-core: ^12.0
- typo3/cms-fluid: ^12.0
Requires (Dev)
- phpstan/phpstan: ^1.10
- typo3/coding-standards: ^0.7
- typo3/testing-framework: ^8.0
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
- Install the extension through the Extension Manager
- Include the static TypoScript template
- 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
- Create a new content element
- Select "TextFlow" from the content type list
- Enter your text
- 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
-
No hyphenation visible:
- Check if TextFlow is enabled in TypoScript
- Verify language settings
- Clear TYPO3 cache
-
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
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
GPL-2.0-or-later. See LICENSE file for details.
Support
- Documentation: docs.typo3.org
- Issue Tracker: GitHub Issues
- Slack: #ext-text-flow on typo3.slack.com