Twitter has a size limit of 1MB, Facebook has a recommended image size of 1200 by 600 (or near that). If the image file is too big, twitter just refuses to render.
Per the Metatag module README.txt (step 4 under section Configuration), the way to solve this would be to specify a particular image style for the token, correct?
Unfortunately, when I enabled the custom settings for "Token" display on my content type, and select a specific image style for an image field, the [node:field_my_image] token stops working completely and the metatags for og:image and twitter:image:src are removed from the page.
As a sanity check, however, if I add the token (%node:field_my_image) to a custom content pane for the content type's node panel variant, then the image is rendered.
What am I missing about making the custom Token display settings work?
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | metatag-n2442183-6.patch | 736 bytes | damienmckenna |
Comments
Comment #1
jwilson3Clarifications to issue summary.
Comment #2
jwilson3Reference to the pertinent README.txt section.
Comment #3
jwilson3I'm aware of the ImageCache_Token module, but would like to avoid an additional module that doesnt have an official release just for this one single token, if at all possible.
Comment #4
damienmckennaI believe the problem is that it outputs an img tag in the token's value - you should be able to confirm this by adding dpm($values) to tidyValue() in metatag.inc.
Comment #5
jwilson3@Damien Thanks man. You're exactly correct. I ended up using Image URL Formatter module (because it has stable release) to get the image style turned into a URL for the token.
Comment #6
damienmckennaActually, lets update the README.txt to mention this module.
Comment #7
damienmckennaComment #8
damienmckennaCommitted. Thanks for finding that, James!