when body field contains tokens using token insert module , meta tag generating tag before actual token replacement occurs thus submitted Tweet had raw token instead of replacement text.

Comments

nithinkolekar created an issue. See original summary.

damienmckenna’s picture

Component: Twitter Cards » Integration with other module
Category: Task » Support request
Status: Active » Postponed (maintainer needs more info)

You should be able to resolve this by modifying the options of the Token display settings for that content type, please give that a try and let me know if it works.

nithinkolekar’s picture

StatusFileSize
new6.65 KB
new7.32 KB
new51.38 KB

may I was not clear in explaining the problem , so attaching the screen shots

1. body field with token (text format is plain text and allowed to have token replacements)
body-field

2. twitter card tag setting for description field
twitter-card-tag

3. node view page where twitter card with raw token
node-view

also tried different available token display setting but no success. I think Metatag is generating twitter card from the field's raw value.

nithinkolekar’s picture

StatusFileSize
new5.71 KB

correct image

damienmckenna’s picture

I understand the problem you're seeing. However, the [node:summary] token's value is generated by node.tokens.inc where it is supposed to run all of the text filters that are configured for that field. That's why I suggest going to the Tokens display settings for that content type and make sure the body field is configured correctly. Please let me know. Thanks.

damienmckenna’s picture

Status: Postponed (maintainer needs more info) » Active

I took a look at Token Insert. Which submodule are you using to do what you want - token_insert_text, token_insert_wysiwyg or token_insert_ckeditor? Looking at token_insert_text it only runs the text processing filters if the user has the "use token insert" permission, whereas neither token_insert_wysiwyg nor token_insert_ckeditor require the permission. I see this as a bug in the Token Insert module. Does the output work correctly if you give the "anonymous user" and "authenticated user" roles the "use token insert" permission?

nithinkolekar’s picture

As mentioned in #3 body field 's text format is set to "plain text" and "Replace tokens" option for plain text is enabled( at /admin/config/content/formats/plain_text) which will work for anonymous too. Ckeditor won't be necessary here as Twitter will strip out html tags anyway.

Token insert (text) is required if you need token list while inserting into body field, but if you know the token format "Token insert UI" module is enough to test with site tokens or any other built in tokens like node/user. For above example [site:name] is tested.

I think enabling "Replace tokens" for plain text is the catch here.

aubergine2010’s picture

Ive the same problem, but the issue is not with token insert module or the related token filter modules. The way the filter module works is, it backtraces the current viewed page and if theres a token, it changes the token with the actual value on the fly.
Metatag module should be doing the same or find any other way to do token_replace if there is any on the body or summary. Which would be a new feature but not a bug fix.

EDIT: Unless this feature is added to metatag, both token insert and token filter modules are actually useless.

damienmckenna’s picture

Status: Active » Closed (won't fix)

I thank you for your contribution to the Metatag module and the Drupal community as a whole. The D7 version of this module is no longer supported, so I am closing this issue.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

damienmckenna’s picture

Status: Closed (won't fix) » Closed (outdated)