I have a need to set a character limit on a content's body_field. I found maxlength, which is great, unfortunately it isn't everything I need since this is a per role situation. Some roles would have a limit, others unlimited. Has anyone successfully been able to apply an alter to the maxlength module to have it work for specific roles only?
Comments
Comment #1
Marko B commentedI would need this to as this is a good option and this module should have it! So we can limit certain users, for example anoymous to 100 chars and others to have unlimited access, so that module is permission based. Now i can make 2 different content types for this, but thing this module should have this option as it very useful.
Comment #2
carsonblack commentedI have done some work on this problem. I actually tried to commit a new project to do just this using the same JavaScript as what is in the Maxlength module. I was not allowed to do so by the people who control commit access to d.o. They felt that it should not be a separate module and should just be a patch. My thought was that adding this capability to the existing maxlength module may overly complicate the user interface to satisfy the needs of only a few of us that need the additional functionality. We respectfully disagree about this, but I do intend on eventually committing a patch to maxlength that will add the per role functionality in a way so that you can turn it off and on. This will make it so per role will get out of the way of those that do not need it.
In the meantime I have posted my maxlength_per_role module on github: https://github.com/carsonblack/Maxlength-Per-Role
Feel free to use it at your own peril! ;-)
Comment #3
hefox commentedPatch in #984794: Create API for non-node forms would likely make that module simpler.
I agree; this could either be a patch or a sub module bundled with maxlength.
#643828: Ignore maxlength by permission is somewhat related.
Comment #4
cedeweyThe Drupal 6 version of Maxlength is no longer supported so I'm marking this Closed (works as designed).
I also encourage you, if you haven't already, to upgrade your site to Drupal 8/9. We are actively maintaining that version and you would enjoy all of the other features of the latest version of Drupal.