Resource icon

XF 2 Tip Instructions for Creating OG:IMAGE tags for Xenforo 2

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
19,125
Points
823

Reputation:

ENXF NET submitted a new resource:

Instructions for Creating OG:IMAGE tags for Xenforo 2 - automatically selecting the largest image file size

Here's how to create og:image tag by finding the file in the post, and automatically selecting the largest image file size.
View attachment 22298
Open the thread_view template, find the following code:
PHP:
<xf:macro template="metadata_macros" name="metadata"
    arg-description="{$fpSnippet}"
    arg-shareUrl="{{ link('canonical:threads', $thread) }}"
    arg-canonicalUrl="{{ link('canonical:threads', $thread, {'page': $page}) }}" />
Replace to...

Read more about this resource...
 

juabo10

Well-known member
Registered
Joined
Aug 20, 2020
Messages
72
Points
28

Reputation:

Hello,
I just used this guide but the facebook og:image is still getting the same default image.

https://mysite.com/styles/default/fb-meta-image.png

Code:
<meta property="og:url" content="https://mysite.com/resources/test-topic-1-5/" />

<meta property="og:site_name" content="SiteName" />

<meta property="og:type" content="website" />

<meta property="og:title" content="SiteName - Testo topic 1" />

<meta property="twitter:title" content="SiteName - Testo topic 1" />

<meta property="og:image" content="https://mysite.com/styles/default/fb-meta-image.png" />

<meta property="twitter:image" content="https://mysite.com/styles/default/fb-meta-image.png" />

<meta property="twitter:card" content="summary" />

Can you help me?

Regards!
 
Last edited:

juabo10

Well-known member
Registered
Joined
Aug 20, 2020
Messages
72
Points
28

Reputation:

anyone can help me please?
 

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
19,125
Points
823

Reputation:

You should set permissions for guests to view photos or attachments and try again
 

juabo10

Well-known member
Registered
Joined
Aug 20, 2020
Messages
72
Points
28

Reputation:

You should set permissions for guests to view photos or attachments and try again
ENXF NETHello, thanks for reply

I have configured the permissions of the "Guest" group allowing it to see the attached files, but after making this configuration Facebook still does not recognize the image OG: IMAGE

The images that I want to be shown are the ones found in the resources section.

Regards!
 

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
19,125
Points
823

Reputation:

Hello, thanks for reply

I have configured the permissions of the "Guest" group allowing it to see the attached files, but after making this configuration Facebook still does not recognize the image OG: IMAGE

The images that I want to be shown are the ones found in the resources section.

Regards!
juabo10I have tested this forum and demo site, everything works, can you send me your forum link link
 

lazarote

web enthusiastic
Collaborate
Registered
Joined
Jun 24, 2019
Messages
141
Points
53

Reputation:

Top