Skip to content

Shows a field counter on specified fields in the SilverStripe CMS (3 & 4)

License

Notifications You must be signed in to change notification settings

PlatoCreative/silverstripe-fieldcounter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

343f308 · Apr 21, 2017

History

15 Commits
Jan 19, 2017
Jan 19, 2017
Feb 13, 2017
Jan 20, 2017
Apr 21, 2017
Jan 12, 2017
Jan 20, 2017
Jan 12, 2017
Jan 12, 2017
Jan 12, 2017
Jan 12, 2017
Jan 12, 2017
Feb 13, 2017
Jan 19, 2017
Jan 20, 2017

Repository files navigation

Silverstripe FieldCounter

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