Compatible XF 2.x versions
  1. 2.2
This guide will help you to set your forum's open graph image. It will use the first image in your thread, whether linked directly or attached.

Open template: thread_view

Find:
Code:
<xf:set var="$fpSnippet" value="{{ snippet($firstPost.message, 0, {'stripBbCode': true}) }}" />

Add below:
Code:
<xf:if is="$thread.cover_image">...
You do not have permission to view the full content of this resource. Log in or register now.
Author
JoyFreak
Views
1,066
First release
Last update
Rating
5.00 star(s) 4 ratings

More resources from JoyFreak

Latest updates

  1. Code updated

    Updated arg-imageUrl from: {{ link({$thread.cover_image}) }} to: {$thread.cover_image} This...

Latest reviews

Great little tweak, not sure why it's not included in the node options.

Using it with a node id conditional for our articles section 😗👌
Thank-you thank-you! This fixed my issues with sharing articles. Needs to be part of the code Xenforo codebase
A real game changer! It picks the first image of any thread and if that thread doesn't have a image attachment, it chooses the Metadata logo that I chosen
JoyFreak
JoyFreak
Thanks for the review!
Thank you. Fixed the og image issue. Was struggling to find a proper solution and came across this code. This did the job.
JoyFreak
JoyFreak
Thanks for the review!
Top