TimTheMiles Posted November 20, 2018 Share Posted November 20, 2018 Hello IPS, So I'm looking to change something for that's been bothering for quite some time. But I don't know how to go about it. My goal is to replace the Sharer Image that shows by default on Profiles. When you share a profile link to Facebook, Twitter, or any other platform. It automatically uses the Sharer Image instead of the Profile Picture. Is there a way to force it to grab the Profile Picture instead? Maybe some snippet of Code I can add to my theme? Link to comment Share on other sites More sharing options...
opentype Posted November 20, 2018 Share Posted November 20, 2018 {{if $member->photo}} {{\IPS\Output::i()->metaTags['og:image'] = $member->photo;}} {{endif}} somewhere in the profileHeader template. Link to comment Share on other sites More sharing options...
TimTheMiles Posted November 20, 2018 Author Share Posted November 20, 2018 I'll get it done! Thanks for all the help! Link to comment Share on other sites More sharing options...
TimTheMiles Posted November 20, 2018 Author Share Posted November 20, 2018 27 minutes ago, opentype said: {{if $member->photo}} {{\IPS\Output::i()->metaTags['og:image'] = $member->photo;}} {{endif}} somewhere in the profileHeader template. OK I added it to the ProfileHeader Template. And then I tested it on Discord and Twitter, but nothing right now. How long do you think it will take before it starts showing? Link to comment Share on other sites More sharing options...
opentype Posted November 20, 2018 Share Posted November 20, 2018 I tested your site. It is working correctly on Facebook for uncached or re-scraped profiles with an image. Twitter is rejecting to create Twitter cards since you have other meta tag errors. That is unrelated to the og:image though. Link to comment Share on other sites More sharing options...
bfarber Posted November 21, 2018 Share Posted November 21, 2018 Note that Facebook has minimum dimension requirements for sharer images, so if any profile image is too small it won't work (or rather, FB likely won't honor the profile image as the sharer image). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.