Hello,

I have a content type that doesn't use the default body field at all. Is there a way to convince the [node:summary] token to look into other fields to build the summary? Or another token that does that?

Also, I could use my custom field's value as a token, but I can't find a way to shorten that to a reasonable length.

Generally asked: how do you deal with node summaries when you don't use the default body field?

Thanks,
Daniel

Comments

Daniel Wentsch’s picture

Issue summary: View changes
Daniel Wentsch’s picture

Ok, to trim the custom field's value when used as a token one can simply activate the token view mode in display settings and set the field formatter to trimmed. That solved it for now.

I'm still wondering if there isn't a way to get a summary from across any fields used in a content type.

DamienMcKenna’s picture

Version: 7.x-1.0-beta9 » 7.x-1.x-dev
Status: Active » Postponed

I've opened up a feature request in the Token module's issue queue asking about this: #2300629: Optionally trim token output

Until that issue is resolved, lets leave this as postponed - at least you have an option for now.

DamienMcKenna’s picture

Status: Postponed » Closed (duplicate)

Because Dave didn't think the string trimming should be a default option in Token, I've opened a new issue in Metatag which covers it and more: #2309017: Automatically trim meta tag lengths (D7)

This new issue will cover this issue.

DamienMcKenna’s picture

Category: Support request » Feature request
Status: Closed (duplicate) » Active

Going to reopen this, we need a native way in Metatag to truncate long meta tag values.

DamienMcKenna’s picture

DamienMcKenna’s picture

Status: Active » Fixed

There are two parts to this issue:

A content type doesn't use core 'body' field, so [node:summary] is always empty.
Use a different token for another text field.
Meta tags are too long, they aren't trimmed to a suitable length.
We'll work on that in another issue: #2309017: Automatically trim meta tag lengths (D7)

Status: Fixed » Closed (fixed)

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

DamienMcKenna’s picture

For anyone who runs into this problem, I started a documentation page of FAQs with some suggested solutions for this problem: https://www.drupal.org/docs/contributed-modules/metatag/frequently-asked...