heimrichhannot/contao-input-counter-bundle

此插件为后端字段提供字符计数功能,以提升编辑易用性。

1.1.2 2022-09-06 06:42 UTC

This package is auto-updated.

Last update: 2024-09-06 10:56:03 UTC


README

此插件为后端字段提供字符计数功能,以提升编辑易用性。

安装

使用composer安装: composer require heimrichhannot/contao-input-counter-bundle

配置

配置非常简单,只需将以下代码添加到 config.php

$GLOBALS['HUH_INPUT_COUNT'] = [
    [
        'table'  => 'tl_news', // the dca table name
        'fields' => [
            [
                'name' => 'headline', // the field's name
                'max'  => 50, // the maximum character count (if not set, the field's maxlength eval property is used if available)
                'skipColoring' => true // activate/deactivate coloring (default: false)
            ],
            // ...
        ]
    ],
    // ...
];

已知限制

  • 由于tinyMCE没有针对每个内容更改(keyup、change、cut和paste有效,但样式更改没有事件)的事件,目前不支持tinyMCE。