XF 2 Use post attachment as logo.og image, get big preview on social shares

drastic

Well-known member
Hey,

Does anyone know an addon, or know how to, or can develop this...

I want to use an image attachment from each post as the logo.og image for that post. This will help us get the big share images when posting a thread on Twitter and Facebook.

This helps because the image will match the content instead of always showing the default logo.og image.
 
  • Like
Reactions: Lee
If you're okay with allowing guests to view attachments then you can either do some template changes or use the below to avoid manual edits.
 
If you're okay with allowing guests to view attachments then you can either do some template changes or use the below to avoid manual edits.


This was working for me, for a while. Not sure what happened for it to stop working.
 
As in the forum, or thread?
The generic forum home page would be using the generic image defined in the ACP so a link to a thread. Also, what version number of the addon.

EDIT: You had me worried that something broke with XF 2.2 and I missed it! 😟 I just checked a random thread over at Cameraderie and, if you view the source and/or try the share buttons, you can see the og:image and twitter:image tags are still being set. (y) The version installed at Cameraderie is the current 1.0.8 release.
 
Last edited:
If you're okay with allowing guests to view attachments then you can either do some template changes or use the below to avoid manual edits.
Hello. Works only with images attachments or with images pasted directly in posts too ? Thanks.
 
Seems to not working with XF 2.2, nothing changes in my twitter card. Do i have to remove the meta tags i put manually in PAGE_CONTAINER ?
 
Seems to not working with XF 2.2, nothing changes in my twitter card. Do i have to remove the meta tags i put manually in PAGE_CONTAINER ?
I don't know what META you may have inserted manually so I can answer that question.

The most common issue is that guests don't have permissions to view attachments.
 
The generic forum home page would be using the generic image defined in the ACP so a link to a thread. Also, what version number of the addon.

EDIT: You had me worried that something broke with XF 2.2 and I missed it! 😟 I just checked a random thread over at Cameraderie and, if you view the source and/or try the share buttons, you can see the og:image and twitter:image tags are still being set. (y) The version installed at Cameraderie is the current 1.0.8 release.



This thread has previously displayed the image;

1603712010350.webp

Now returns;

1603712053237.webp
 

This thread has previously displayed the image;

View attachment 238386

Now returns;

View attachment 238387
You seem to be using some kind of add-on to give the threads an 'article' look to them and, from viewing the page source, that doesn't seem like the normal XF output. I tried finding a thread to view that is using the normal XF page output but couldn't find any; if you view one (a normal thread that isn't using any add-ons, etc.) how does it look in regards to the OG image?
 
You seem to be using some kind of add-on to give the threads an 'article' look to them and, from viewing the page source, that doesn't seem like the normal XF output. I tried finding a thread to view that is using the normal XF page output but couldn't find any; if you view one (a normal thread that isn't using any add-ons, etc.) how does it look in regards to the OG image?


I used to have xenporta running, although I removed this when I upgraded to 2.2

Theres nothing else that should interfere I don't think.

Other than my styles anyway.
 
Last edited:
I used to have xenporta running, although I removed this when I upgraded to 2.2

Theres nothing else that should interfere I don't think.
You're not making this easy to help out. There's obviously some type of add-on installed and in use that is modifying how the threads look. Is XenPorta still being used to modify how the threads look when viewing them? Are you using some type of template edits to modify them? Do you have any 'SEO' type add-ons installed? Do you have a test install that you can try stuff out on?
 
You're not making this easy to help out. There's obviously some type of add-on installed and in use that is modifying how the threads look. Is XenPorta still being used to modify how the threads look when viewing them? Are you using some type of template edits to modify them? Do you have any 'SEO' type add-ons installed? Do you have a test install that you can try stuff out on?

Sorry not trying to be difficult.

Xenporta was completely removed when I upped to 2.2

I have a limited amount of Add-ons currently, I don't think they would interfere, but wouldn't say that with confidence.

I will investigate with my local install, bring the installation down to vanilla.
 
Ok so I have an update on this;

Addons currently installed are;

Cinvin style tweaks
Connected accounts
[TH] nodes
[TH] UIX
Xenmake style properties
XTR Featured thread slider
Tag cloud widget
Member stats
Threadloom
XFMG

I have uninstalled everything I had disabled. No change, still doesnt produce the image.
 
Back
Top Bottom