For my current project, I needed a more robust character count that was was out there, so I started by looking at what Andrew Weaver had done with his, and came up with this offering.
MD Character Count will show character counts below textareas, text inputs, and MD Markitup fields in the CP. You can set character counts to “soft” (which is the 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.
You can download it from the MD Character Count page at Masuga Design.
Hi Ryan,
Will post here as well as your site to say this is an excellent little extension well done and thanks for sharing it!!
Just one thing though I couldn’t seem to get this to work unless I enabled the jQuery For Control Panel extension. I thought from reading the documentation that it should work without it but couldn’t seem to get it to work like that. Works great though with the other extension on so thanks.
Best wishes,
Mark
@Mark: 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 (LG Data Matrix, in my testing). That’s the sort of the thing the CP jQuery extension was intended to help address.
@Rob: Word count would be nice, sure. And so would being able to ignore HTML. I’m not married to the jQuery plugin I’m using - it seemed lightweight, but I did have to modify it to allow for soft counts. If there is a better character/word counting jQuery extension out there, point me to it and maybe I can beef this up with some extra settings.
Hi Ryan,
Ah right. Could possibly be another extension then although to tell the truth I don’t think any of the other extensions I have on the site use jQuery. Could be wrong on that though.
Anyway will just go with using the jQuery extension as that is much neater anyway.
Again thanks for a fantastic extension, really nice this one!! 😉
Best wishes,
Mark
I know your specs state that the plugin is MSM aware,
however when I change from site to site I get an error in my page above all HTML :
Notice: Undefined index: 2 in /www/htdocs/cebuco/http/system/extensions/ext.md_character_count.php on line 110
Where index 2 is the index of the site.
I used both the custom path for jquery, and when I encountered the problem the CP jquery extention. But that made no difference.
Any idea what can cause this? Thank you.
Here’s a jQuery word count plugin I found. I need it for a SAEF, but might have something useful for the extension.
I haven’t fixed that. I think the only thing you need to do is go into the MDCC settings for that site and hit “Submit” once and that error should go away.
I would get on this, but I think the above will solve the issue for each site for now, and I have a certain EE-related site I’m trying to get launched as soon as possible. It’s on my to-do list, though.
I’m almost 100% positive this has to do with the settings not getting set by default - hence having to hit “Submit” to get the settings in there. With a launch of devot:ee coming very soon I just don’t have time to get on this immediately. It’s still on my to-get-to list.
Thanks for posting the notices.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.