MyBB Community Forums

Full Version: Appear thumbnail when i post to another site
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello to all , 

how to appear thumbnail (automatically) when i post to another site (for example fb)?
are you using MyBB or other forum system ? above attachment is showing other system.

anyway, there is no easy method to get image from the posted content to use for sharing.
one can simply use og:image tag in the header to send a static image (eg. site logo) to facebook
(2020-02-18, 04:03 PM).m. Wrote: [ -> ]are you using MyBB or other forum system ? above attachment is showing other system.

anyway, there is no easy method to get image from the posted content to use for sharing.
one can simply use og:image tag in the header to send a static image (eg. site logo) to facebook


I just install a new fresh mybb  and doing some tests in order the new forum will work fine .
Shall I open the index.php to do this ?
Hello,
you can add the og:image tag as .m. said - you can add it to the headerinclude template.
To do that, go into the ACP (yourforum.tld/admin in most cases), open the Themes & Templates tab, select Themes (on the left sidebar), open your theme, go into Ungrouped Templates, and open headerinclude. There, add <meta property="og:image" content="https://url-to-image.here"/> anywhere outside the <script> tags - so, for example, at the top.
Save, wait a bit for Facebook to register that it's there, and it should work.
see also MyBB Templates guidance

content sharing plugins are also available for facebook & twitter (eg.)
How can I make the meta property for og:image go to the attachments on the thread so I can choose one of those to post with the thread on Facebook?  Any help would be appreciated.
I have this on my site, but I created a custom plugin to pull the image as a preview image. the bottom line is, you will need a plugin that pulls the attachment image as a variable like

{$attach['image']}

Then you have to place said variable into

<meta property="og:image" content="{$attach['image']}">

and Wholla, that is what you are looking, but now you need a plugin or come up with a way to pull attach image
(2021-12-13, 08:36 PM)Michael2014 Wrote: [ -> ]I have this on my site, but I created a custom plugin to pull the image as a preview image. the bottom line is, you will need a plugin that pulls the attachment image as a variable like

{$attach['image']}

Then you have to place said variable into

<meta property="og:image" content="{$attach['image']}">

and Wholla, that is what you are looking, but now you need a plugin or come up with a way to pull attach image

Thank you for the insight.  I appreciate it.  I'll look into it.