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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna’s picture

Title: Character Count on Page Title » Character count on fields
Version: 7.x-1.0-beta4 » 7.x-1.x-dev
Component: Miscellaneous » User interface

Lets make this a general task of displaying the character count on all fields.

Dave Reid’s picture

There 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.

MrPaulDriver’s picture

May I ask whether there has been any integration with cck_count or maxlength modules?

DamienMcKenna’s picture

Priority: Normal » Minor

Reducing 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 :)

DamienMcKenna’s picture

Status: Active » Postponed
drurian’s picture

Issue summary: View changes

I 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?

JeroenT’s picture

Status: Postponed » Needs review
FileSize
821 bytes

I created a patch that adds this behaviour. I used the maxlength module for this.

DamienMcKenna’s picture

Status: Needs review » Needs work

I'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).

JeroenT’s picture

@DamienMcKenna,

That was also the part I didn't like. I'll try to provide a patch on the issue of the Maxlength module.

JeroenT’s picture

Created a new patch. After installing patch #2 in #2329441: Unlimited field, just a character count this worked for me.

DamienMcKenna’s picture

@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.

FiNeX’s picture

Hi, this patch combined with the maxlength one works fine. Thanks!

cmseasy’s picture

Added related isue

josephdpurcell’s picture

I agree--I think hard coding a restriction to 150 characters is too restrictive. Would it be possible to make the value configurable?

DamienMcKenna’s picture

Any character counts should be tied to the functionality that will be added in #2309017: Automatically trim meta tag lengths (D7).

DamienMcKenna’s picture

Status: Needs work » Postponed
Related issues: +#2329441: Unlimited field, just a character count

Lets see if #2329441: Unlimited field, just a character count is committed first, then we can use it.

Rar9’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev

A 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

DamienMcKenna’s picture

Status: Postponed » Active
DamienMcKenna’s picture

Title: Character count on fields » Character count on fields with Maxlength integration (D7)
Version: 8.x-1.x-dev » 7.x-1.x-dev
Status: Active » Needs work

We 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.

DamienMcKenna’s picture

Title: Character count on fields with Maxlength integration (D7) » Character count on fields via Maxlength integration (D7)
DamienMcKenna’s picture

Status: Needs work » Needs review
FileSize
3.54 KB

How about something like this? It provides integration with Maxlength, but provides an option to disable it if it proves to not be worth it.

DamienMcKenna’s picture

Some minor logic refinements.

  • DamienMcKenna committed be797a82 on 7.x-1.x
    Issue #1918738 by DamienMcKenna, JeroenT, gowrann, Dave Reid: Character...
DamienMcKenna’s picture

Status: Needs review » Fixed

Committed. Thank you all.

  • DamienMcKenna committed b9bbfe91 on 7.x-2.x
    Issue #1918738 by DamienMcKenna, JeroenT, gowrann, Dave Reid: Character...
DamienMcKenna’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.