webcoast/character-counter
Composer 安装命令:
composer require webcoast/character-counter
包简介
Show a character counter below text fields in TYPO3 CMS
README 文档
README
What does it do?
This extension allows you to display a character counter in the form of 23 / 60 below input fields,
text areas and RTE fields. This is most useful for SEO related fields, so that editors get a hint,
if their title or description matches the requirement.
This does not limit the number of characters, that can be entered. This counter is for informational purpose only.
Installation & configuration
The extension is available from packagist.org
composer require webcoast/character-counter
or from TYPO3 extension repository.
Usage
To enable the character counter for a certain field, use the TCA helper method in your TCA/Overrides files.
Pages: seo_title
In Configuration/TCA/Overrides/pages.php add:
\WEBcoast\CharacterCounter\Helper\Tca::enableCharacterCounter('pages', 'seo_title', 60, 40);
The last argument warning is optional and defaults to 80% of the third argument max.
You can also adjust your TCA manually by adding the follow to the field's config section:
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA']['pages']['columns']['seo_title']['config'], [ 'fieldWizard' => [ 'characterCount' => [ 'renderType' => 'characterCountWizard' ] ], 'characterCount' => [ 'warning' => 120, // Optional: Defaults to 80% of `max` 'max' => 160 ] ] );
Contributing
Feel free to fork and provide a PR or open an issue.
统计信息
- 总下载量: 309
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2021-06-23