Resource icon

Unmaintained Facebook’s Open Graph Image or og:image For Forums and Threads 1.0.0

No permission to download
Compatible XF 1.x versions
  1. 1.5
License
Creative Commons license
Visible branding
No
XenForo’s open graph image is sitewide and you can’t specify different images to different forums and threads. It becomes boring on social media where images are a major part of making content go viral.

Thanks to @vlom31 of HackerDeCroissance for sharing the idea, paying me to develop it and then allowing it to share it.

With this plugin, you have different open graph images for forums and threads. The forum open-graph images are to be uploaded via FTP. For threads, admins and moderators can upload images to be used as open-graph images or specify external url.

How To Install The Plugin?

Unzip the file. It contains an upload folder, an XML File named addon-OG.xml and a Readme.html file.

Inside upload folder there is a library folder and data folder.

Upload files and directories inside library to XenForo’s library directory, thereby creating a directory named OG inside the library folder on your server.

Very detail instruction with screenshots to install any addon is here.

Inside the data folder, there is a nodesog folder. Put all the Open Graph Images for each forum in the format FORUMID.jpg

The forum id is the one that you see in the url window when editing the node in the admin area.

nodes-id-2.png


So 6 is the node id in the screenshot above. So the ogimage for this forum will be 6.jpg inside the nodesog folder. (Keep the extension in lower case as Unix and Linux servers are case sensitive and 6.JPG is not same as 6.jpg)

Now import the .xml file using XenForo add-on importer.

Screenshots
1_Facebook-Scrape-1.png


Facebook Scrap Information.

1_Edit_Thread-1.png


Edit a thread and upload the ogimage url. You can even specify an external url for ogimage.

The Open graph title is just in case you do not wish to use the thread title on social media and want to be using a custom title for threads.

Precedence for OG Images

The default og:image inside the style properties won’t be used for any thread or forums and it will be only for the homepage and other than forums and thread pages.

For forums, images in the nodesog folder will be served for open graph images.

For threads, the order of precedence for open graph images is as follows:

  1. First choice is url of the image specified.
  2. Second choice is the uploaded image for the thread.
  3. Last it will revert to the image for the forum.
The plugin doesn’t honor attachment view permissions which mean even if the attachments are set to be visible only to members, the images uploaded via this plugin will be visible to everyone.

What is the preferred dimension for images?

Facebook recommends the width to height ratio to be 1.91. I prefer to keep it at 800px wide and 418 px height but you are free to use any preferred dimension of your choice.

Error attachment too big?

If you find an issue of the file too large when trying to upload a file.

FileTooBigError.png


Make sure your attachment settings allow upload of bigger files.

FileTooBigError_Fix.png


The settings are same for all the attachment and are under Admin > Options > Attachments.

What if FB still can’t pull the og image?

This can happen at times when FB does not pull things from the server and uses its own cache.

View the source code of the thread page to see if it contains og:image tag?

If the answer is yes, FB is pulling the data from cache. Use Facebook’s sharing debugger tool to rescrape the content from the server again.

If you don’t see the og:image tag, you may be using a custom theme and my template modifications aren’t working as expected. Share them in comments here or on my blog and I will be more than happy to help you.
Author
shabbirbhimani
Downloads
106
Views
4,723
First release
Last update

Ratings

5.00 star(s) 2 ratings

More resources from shabbirbhimani

Latest reviews

Just what i was looking for, something that looks more professional when sharing a thread to facebook. 5 stars, thank you.
Awesome job by Shabbir as usual on this add-on.
Absolutely necessary for anyone that uses their xenforo as a media platform (posting guides, videos etc.. as you would on a blog) and would like to encourage their members to share their content.
shabbirbhimani
shabbirbhimani
Thanks for the review as well.
Back
Top Bottom