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

Generate og:image:width and og:image:height #19

Closed
fritzmg opened this issue Nov 29, 2017 · 11 comments
Closed

Generate og:image:width and og:image:height #19

fritzmg opened this issue Nov 29, 2017 · 11 comments

Comments

@fritzmg
Copy link
Contributor

fritzmg commented Nov 29, 2017

When a content is shared on Facebook for the first time, the share dialogue won't show the og:image right away. There are two ways to make Facebook show the share image even when the URL is shared for the first time: https://stackoverflow.com/a/30361572/374996

Within Contao it probably makes sense to take the second approach, i.e. generating og:image:width and og:image:height.

Note: I realize your extension allows for more than one og:image to be present for legacy reasons. May be this feature should be dropped? I don't think there is any reason anymore to have more than one og:image defined.

@qzminski
Copy link
Member

Note: I realize your extension allows for more than one og:image to be present for legacy reasons. May be this feature should be dropped? I don't think there is any reason anymore to have more than one og:image defined.

I think it's mostly there to give the user a choice which image he would like to use. Would it harm if we add og:image:width and og:image:height to all images?

@fritzmg
Copy link
Contributor Author

fritzmg commented Nov 30, 2017

I think it's mostly there to give the user a choice which image he would like to use.

Well, where can you do that? Facebook for instance does not offer to switch through multiple share images, when sharing a post.

Would it harm if we add og:image:width and og:image:height to all images?

I suppose not - though it would generate a lot of additional markup. Also, how would you be able to identify which og:image:width belongs to which og:image?

@qzminski
Copy link
Member

Well, where can you do that? Facebook for instance does not offer to switch through multiple share images, when sharing a post.

This must have changed because at the time I developed this extension it was possible. Or was it another service... 🤔

I suppose not - though it would generate a lot of additional markup. Also, how would you be able to identify which og:image:width belongs to which og:image?

Just like a regular array: http://ogp.me/#array

@fritzmg
Copy link
Contributor Author

fritzmg commented Nov 30, 2017

This must have changed because at the time I developed this extension it was possible. Or was it another service... 🤔

Yeah, it was possible in the past. That's why I said "for legacy reasons" ;)

@qzminski
Copy link
Member

I would preserve the multiple selection of images as the OpenGraph protocol is not a Facebook protocol and other services are potentially making use of those arrays. Agreed?

@fritzmg
Copy link
Contributor Author

fritzmg commented Nov 30, 2017

Agreed.

@qzminski
Copy link
Member

qzminski commented Dec 2, 2017

Implemented in d177f82 but this can produce unexpected results because of contao/core-bundle#1214.

@fritzmg
Copy link
Contributor Author

fritzmg commented Dec 2, 2017

Yeah, see the comments though: you should just combine each og:image/og:image:width/og:image:height combo into one string.

@qzminski
Copy link
Member

qzminski commented Dec 4, 2017

The 3223cd7 should do then.

@qzminski qzminski closed this as completed Dec 4, 2017
@madmaharaja
Copy link

madmaharaja commented Mar 8, 2019

This must have changed because at the time I developed this extension it was possible. Or was it another service... 🤔

Yeah, it was possible in the past. That's why I said "for legacy reasons" ;)

Just bumped into this thread because I was looking for a way to add og:image:width and og:image:height to my page templates in Contao. Anyway, just for the record: It is still (or again?) possible to switch through and select from multiple ogimage files when sharing a URL on Facebook.

@fritzmg
Copy link
Contributor Author

fritzmg commented Mar 11, 2019

Yeah, I also noticed that this feature has returned on Facebook.

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

No branches or pull requests

3 participants