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?

CommentFileSizeAuthor
#6 metatag-n2442183-6.patch736 bytesdamienmckenna

Comments

jwilson3’s picture

Issue summary: View changes

Clarifications to issue summary.

jwilson3’s picture

Issue summary: View changes

Reference to the pertinent README.txt section.

jwilson3’s picture

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

damienmckenna’s picture

Category: Bug report » Support request

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

jwilson3’s picture

Status: Active » Closed (works as designed)

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

damienmckenna’s picture

Status: Closed (works as designed) » Active
StatusFileSize
new736 bytes

Actually, lets update the README.txt to mention this module.

damienmckenna’s picture

Status: Active » Needs review
damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thanks for finding that, James!

  • DamienMcKenna committed 402a440 on 7.x-1.x
    Issue #2442183 by DamienMcKenna, jwilson: Mention the Image URL...

Status: Fixed » Closed (fixed)

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