plato-creative/silverstripe-fieldcounter

There is no license information available for the latest version (2.1.0) of this package.

Adds a counter to defined fields to show remaining characters

Installs: 20 179

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 2

Forks: 5

Open Issues: 1

Language:JavaScript

Type:silverstripe-module

2.1.0 2017-02-13 21:04 UTC

This package is auto-updated.

Last update: 2024-03-22 09:25:20 UTC


README

Shows a field counter on specified fields in the SilverStripe CMS

Usage

To add the field counter to a Silverstripe field in the CMS you need to add:

TextField::('myfield')->setAttribute('data-fieldcounter', 140);

If you require different limits change the 140. Note: Adding this to a TextareaField prevents new lines.

If you want to prevent more text than your limit, use the built in HTML attribute maxlength e.g.

TextField::('myfield')->setAttribute('maxlength', 140);

Install

SilverStripe 3

$ composer require plato-creative/silverstripe-fieldcounter:1.*

SilverStripe 4

$ composer require plato-creative/silverstripe-fieldcounter:2.*

Documentation

See Docs