Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could twitter:image support be added? #36

Closed
bright-cloud-studio opened this issue Dec 21, 2022 · 2 comments
Closed

Could twitter:image support be added? #36

bright-cloud-studio opened this issue Dec 21, 2022 · 2 comments

Comments

@bright-cloud-studio
Copy link

Hi there,

We have used this package on a website and ran into an interesting situation. Although things worked as expected for Facebook, Twitter would not grab the correct image. After looking into it our best guess was that although there is an image linked in the og:image tag there was no twitter:image tag.

Although I am not a fan of this, I modified https://github.com/codefog/contao-social_images/blob/master/src/ImageGenerator.php and copied line 91 and just changed og:image to twitter:image and now the twitter card is displaying the correct image.

Is it possible to add support for this natively? Either a checkbox to choose to use OpenGraph, Twitter cards or both? Just brainstorming.

@fritzmg
Copy link
Contributor

fritzmg commented Dec 21, 2022

Twitter falls back to og:image or the new meta tag as far as I know, so that's not really necessary imho.

@bright-cloud-studio
Copy link
Author

Hmm, I wonder if maybe Twitter cached the card and that is why we were not seeing the changes reflecting with og:image. I wasn't aware that it used it as a fallback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants