With simple token [node:field_sample_question] (provided by Token module) twitter:image metatag is not generating.
Also when tested with [node:field-sample-question] provided by Entity Token (which is required as my site is based on Quiz module) following invalid metatag is generating
<meta name="twitter:image" content="http://enhancetalent(dot)com/Property%20field_sample_question" />
test link for [node:field_sample_question] (provided by Token module)
http://enhancetalent(dot)com/content/qz118-micro
test link for [node:field-sample-question] (provided by Entity Token module)
http://enhancetalent(dot)com/content/qz119-micro
enabled Metatag modules (rest is disabled)
Metatag 7.x-1.21+9-dev
Metatag: Twitter Cards 7.x-1.21+9-dev
other modules
Token 7.x-1.6+8-dev
Entity tokens 7.x-1.8+1-dev
Drupal Core 7.52
update: links removed as #4 solution is applied
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | #2885131-sample question-image-field-config.png | 101.7 KB | nithinkolekar |
| #9 | #2885131-default-display-settings-for-image.png | 31.99 KB | nithinkolekar |
Comments
Comment #2
nithinkolekar commentedjust clean..
Comment #3
nithinkolekar commentedComment #4
nithinkolekar commentedas a temporary workaround I created new image style with same size as the original image because there is no token for original images by https://www.drupal.org/project/imagecache_token.
Then I used [node:field_sample_question:summary_large:uri] [node:field_sample_question:summary_large:width] and [node:field_sample_question:summary_large:height] and it worked fine.
But problem is present with original [node:field_sample_question] token and twitter:image metatag is not generating.
Comment #5
nithinkolekar commentedComment #6
nithinkolekar commentedComment #7
damienmckennaThis sounds like the token view mode display settings for the field are causing problems. How is the image field set to be configured for the "default" display mode?
Comment #8
damienmckennaComment #9
nithinkolekar commentedtoken view mode display settings is not enabled, should it be enabled to work this module?
default display settings for image

OT: with the issue is still present I got the workaround as mentioned #4 but as for the status changed to "support request" is that mean any issue related to live site will be changed so? Just curious.
Comment #10
damienmckennaThe token view mode does not need to be enabled.
I changed it from "bug report" to "support request" because of my belief there might be a configuration or documentation issue at fault, but if it turns out to be a bug I'll see what I can do about fixing it.
What module are you using to add those class fields to the image?
Comment #11
nithinkolekar commentedField formatter class : https://www.drupal.org/project/field_formatter_class
classes : https://www.drupal.org/project/image_class
also tested by disabling those modules,cache-clear and with config below but failed generating twitter:image card.
Image URL: [node:field_sample_question]
Image width: 800
Image height: 400
Comment #12
damienmckennaWhat type of field is the "sample_question" field?
Comment #13
nithinkolekar commentedIts a image field.
Attaching the config in case for finding other module conflicts
Comment #14
damienmckennaThanks. Have you tried looking at the Devel - Token tab to see what the token's output is?
Comment #15
nithinkolekar commentedviewing devel token page ends with WSOD :(
Tried token_tweak with limit 1 and also increased max execution limit 240 but nothing worked.
Metatag: Devel
could this module can be useful debugging this issue? is there a doc?
Comment #16
damienmckennaThat sucks :-\
Metatag:Devel is just for some integration with Devel Generate, it doesn't help in this scenario.
You could try using dpm() in DrupalTextMetaTag::getValue(), just inside the if(!empty($this->info['image']) part to see what $value looks like.
Comment #17
nithinkolekar commentedfor tokens's [node:field_sample_question]
<empty>for entity api's [node:field-sample-question]
Property field_sample_questionComment #18
jenlamptonI ran into this same problem when I had un-checked the node type in the "Master controls for all entities" fieldset on the settings page.
The label there indicates that those checkboxes control whether the vertical tab for metatags will appear on the entity edit form (and I didn't need to override metatag values on a per-node basis on my site).
It turns out that these checkboxes also affect whether field-based metatags print out or not. Things like
og:titlewere unaffected.Comment #19
damienmckennaI 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.