-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
support multiple og images #11
base: master
Are you sure you want to change the base?
Conversation
if getOGImage returns an array, handle it gracefully
@lekoala I don't follow why Thanks for the PR but I think that this is something you could solve in your own projects instead of this module by applying the logic you've used here in your own getOGImage() function. If I've misunderstood the intention here feel free to re-open or add a comment! |
I assume this module is made to be compatible with https://github.com/tractorcow/silverstripe-opengraph
so basically, it would be great to support this feature in your module. My pull request is not perfect as it only takes into account the first image, but what would really be great is to actually support array from og image and make some kind of slider into the preview. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, in that case could you make a couple of tweaks and then it looks good. Thanks
<p class="share-care-description">$OGDescription</p> | ||
</div> | ||
</div> | ||
<div class="share-care-preview"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use tabs for indentation on html files
* | ||
* @return string | ||
*/ | ||
public function getMainOGImage() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change this to getFirstOGImage
? I feel like that's more descriptive and less likely to confuse me later.
Side note, do you know if 'multiple resolutions' means multiple resolutions of the same image? That would be my assumption, but would be interesting if instead you can supply a variety of different images for sharers to choose from... Is that what you're implying regarding the slider comment? Do you know if Facebook or other sites lets you choose from a range of images if you supply more than one image OG tag? |
actually, that's how I used it : to allow choosing between multiple images. I discovered the actual documentation from Facebook when you asked about my changes :-) I'm working on the project that require this feature in one week or two I'll update the pull request at that time |
this is a small patch to handle arrays from getOGImage