Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
One good feature from page_title module was the character count on the characters entered into the field - any chance this can be implemented into meta_tag, it certainly helps when targeting the 70 character sweet spot for SEO purpose.
Comment | File | Size | Author |
---|---|---|---|
#22 | metatag-n1918738-22.patch | 3.62 KB | DamienMcKenna |
| |||
#22 | metatag-n1918738-22.interdiff.txt | 1.07 KB | DamienMcKenna |
#21 | metatag-n1918738-21.patch | 3.54 KB | DamienMcKenna |
| |||
#10 | character_count_on_fields-1918738-9.patch | 839 bytes | JeroenT |
#7 | character_count_on_fields-1918738-7.patch | 821 bytes | JeroenT |
Comments
Comment #1
DamienMcKennaLets make this a general task of displaying the character count on all fields.
Comment #2
Dave ReidThere are modules out there already like http://drupal.org/project/cck_count and http://drupal.org/project/maxlength. I would suggest we make it possible to integrate with these modules, but not do anything too much on our own.
If not possible with another module, then allowing an external library to optionally integrate would be nice as well:
Also this needs to account for tokens which could result in any number of characters. So it would be easy to be confusing for users since a string like 'Test title for [node:title]' while displayed as 27 characters, could easily be way more than that in reality.
Comment #3
MrPaulDriver CreditAttribution: MrPaulDriver commentedMay I ask whether there has been any integration with cck_count or maxlength modules?
Comment #4
DamienMcKennaReducing this to Minor priority as it's not something I'm going to do for 1.0.
That said, if someone wants to put together a patch that integrates with another module, I'll definitely consider it :)
Comment #5
DamienMcKennaComment #6
drurian CreditAttribution: drurian commentedI have a question about form alter. I'm trying to add maxlength js to the description field using form alter. But no matter what form id I use it doesn't show description or abstract (only title). Is there another way of doing it?
Comment #7
JeroenTI created a patch that adds this behaviour. I used the maxlength module for this.
Comment #8
DamienMcKennaI'm not going to apply this as-is, but I think Maxlength would be a great module to support, if they add character count support in the API (#2329441: Unlimited field, just a character count).
Comment #9
JeroenT@DamienMcKenna,
That was also the part I didn't like. I'll try to provide a patch on the issue of the Maxlength module.
Comment #10
JeroenTCreated a new patch. After installing patch #2 in #2329441: Unlimited field, just a character count this worked for me.
Comment #11
DamienMcKenna@JeroenT: I don't want to add a max count on fields that don't need it or have questionable standards (e.g. "description" has value up through ~300 characters), but I would like to try enabling MaxLength's character count on all text fields.
Comment #12
FiNeX CreditAttribution: FiNeX commentedHi, this patch combined with the maxlength one works fine. Thanks!
Comment #13
cmseasy CreditAttribution: cmseasy commentedAdded related isue
Comment #14
josephdpurcell CreditAttribution: josephdpurcell at Digital Bridge Solutions for American Medical Association commentedI agree--I think hard coding a restriction to 150 characters is too restrictive. Would it be possible to make the value configurable?
Comment #15
DamienMcKennaAny character counts should be tied to the functionality that will be added in #2309017: Automatically trim meta tag lengths (D7).
Comment #16
DamienMcKennaLets see if #2329441: Unlimited field, just a character count is committed first, then we can use it.
Comment #17
Rar9 CreditAttribution: Rar9 commentedA follow-up on
https://www.drupal.org/project/metatag/issues/1918738
The Modul max length offers the the given features without being too restricted.
So an integration would help
https://www.drupal.org/project/maxlength
Comment #18
DamienMcKennaComment #19
DamienMcKennaWe have support in the module for allowing meta tags to have a maximum length, so let's leverage that on the form output.
I think this should be handled by adding the maxlength values to the form output when the module's settings are configured to limit the individual tag. There's some WIP in the earlier patches that just needs to be refined so the form elements are added in a generic way.
Comment #20
DamienMcKennaComment #21
DamienMcKennaHow about something like this? It provides integration with Maxlength, but provides an option to disable it if it proves to not be worth it.
Comment #22
DamienMcKennaSome minor logic refinements.
Comment #24
DamienMcKennaCommitted. Thank you all.
Comment #26
DamienMcKenna