MD Character Count

Show character counts below textareas, text inputs, and MD Markitup fields in the CP.

Download MD Character Count 1.0.4 (9kb zip)

This version posted November 14, 2008
Downloads: 56

Overview

MD Character Count Settings

Show character counts below textareas, text inputs, and MD Markitup fields in the CP. You can set character counts to “soft” (default) which is more of a suggestion, or “hard” which will limit the field to that many characters and no more. You can also customize the message underneath each field.

  • MSM Aware
  • Works with LG Addon Updater to let you know if the version you’re using is outdated

Basic Steps for Installing and Using MD Character Count

  1. Put the ext.md_character_count.php file in your extensions folder
  2. Put the lang.md_character_count.php file in your language/english folder
  3. Put the jquery.charcounter.js file anywhere you like—you’ll reference it in the extension settings
  4. Enable the extension, and modify any of the settings you need
MD Character Count

Settings

There are a number of settings.
Extension Access – Enable access on a site-by site basis if using MSM (Multi-Site Manager)
Scripts – MD Character Count requires two scripts. They are jQuery Core v1.2.6+ and a modified version of the jQuery Charcounter Plugin (modified version is bundled with the extension). If you are using EE 1.6.5+, you can simply enable the CP jQuery extension that is included in the extensions folder.
Character Count Fields – This extension loops through all of the fields in your site and lists all the textareas, text inputs, and MD Markitup fields. There are three settings for each of your custom fields: Count, Count Type, and Count Format.

  • Count – If field is left blank then no count will display or be imposed.
  • Count Type – A “soft” count allows the user to type beyond the max set in “Count”. When the max is exceeded, the Count Format will change style (specified in the CSS) as a warning. A hard count will cap the text entry so that the Count cannot be exceeded. NOTE: Be careful assigning a field that already has data in it to a “hard” count, as you will lose the characters beyond the number in your Count field.
  • Count Format – If nothing is entered, the format will default to: “%1/_count_ characters remaining” where “%1” is the number of typed characters, and count is the number entered in the Count field. You can enter anything here (note that count is not a real variable. If you need the max shown in the Count Format, you have to enter it manually). There are samples shown in the extension settings.

CSS – The default styles for the text that shows below your fields can be altered here.
Check for updates? – Works with LG Addon Updater. If you have LG Addon Updater installed, and this is set to “Yes”, you will be notified of new updates on the Control Panel homepage.


EE Forum Thread

There is a related EE Forum thread for MD Character Count here.

This entry was last updated November 14, 2008.


3 Comments

  1. 1. Mark Bowen

    November 14th, 2008

    Hi Ryan,

    Just wanted to say well done on a great little extension. Works great!!

    One thing though is that I could only get this to work if I installed the jQuery for Control Panel extension. It wouldn’t work without it. Not sure if it’s mean to or not?

    Best wishes,

    Mark

  2. 2. Ryan Masuga

    November 14th, 2008

    I would suggest always turning on the CP jQuery extension. If other extensions are written to look for this, it will help avoid conflicts.

    This extension should definitely work without having to install CP jQuery, but it might not depending on whether you have other extensions installed that are also calling jQuery. If those others are older and not set up to look for other extensions also calling jQuery (like this one), sometimes jQuery can be loaded more than once in the head which can cause some extensions to fail - I’ve seen some of Leevi’s extensions fail because of this too. That’s the sort of the thing the CP jQuery extension was intended to help address.

  3. 3. Ryan Masuga

    November 14th, 2008

    I’m going to close comments here so that the discussion will take place over on the EE forum thread for this.

Sorry, comments are closed.