The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Link image preview meta tag for each thread

2 posters

Go down

In progress Link image preview meta tag for each thread

Post by darksshades April 15th 2020, 9:48 pm

Technical Details


Forum version : #ModernBB
Position : Founder
Concerned browser(s) : Google Chrome
Screenshot of problem : https://i.ibb.co/f1Fkqbb/forumdisplay.jpg
Who the problem concerns : A few members
Forum link : https://vnrpg.forumeiros.com/t2-testing-discord-ogimage-preview

Description of problem

I'm trying to have the first image of the thread/topic be displayed on the link preview of discord.
That's the default behavior of blogs like wordpress and I'd like to have that behavior on this forum threads as well.

Discord will always use Open Graph meta tags. But the "og:image" meta tag for this forum seems to be static.
The tag in question is automatically generated on the templates->general->overall_header with the {META_FB_LIKE} line and I don't have control over that as far as I know.

I've tried making a javascript to change it but that did not work. Discord will not execute the javascript as it only needs the html to find the meta tags.

Is there a setting I'm missing or any way to do this on forummotion?



PS: I've also saw some plugins that claims to do exactly this like https://github.com/LotusJeff/socialshare
But that seems like is for self-hosted phpbb and requires access to add plugins.
darksshades
darksshades
New Member

Posts : 4
Reputation : 1
Language : Brazilian

https://www.forumotion.com/

Back to top Go down

In progress Re: Link image preview meta tag for each thread

Post by SLGray April 16th 2020, 12:59 am

Are you trying to share content from your forum on Discord?


Link image preview meta tag for each thread Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51493
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: Link image preview meta tag for each thread

Post by darksshades April 16th 2020, 11:17 am

SLGray wrote:Are you trying to share content from your forum on Discord?

Yes, I'd like to paste a link on discord and have it display the first image of the thread on the preview like wordpress links do for blog posts.
darksshades
darksshades
New Member

Posts : 4
Reputation : 1
Language : Brazilian

https://www.forumotion.com/

Back to top Go down

In progress Re: Link image preview meta tag for each thread

Post by SLGray April 16th 2020, 9:34 pm

Does Discord offer any way to do this?   If yes, please post the link to it.


Link image preview meta tag for each thread Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51493
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: Link image preview meta tag for each thread

Post by darksshades April 16th 2020, 10:36 pm

SLGray wrote:Does Discord offer any way to do this?   If yes, please post the link to it.

Yes, discord uses Open Graph Protocol(https://ogp.me/).
Here is a confirmation if you want https://twitter.com/discord/status/952834253842153472

But I don't think it's possible to dynamicaly change the og:image meta tags on forummotion. It'd require either a plugin or a custom php which I we don't have access to.
I tried to use the template's <!-- PHP --><!-- ENDPHP --> but it's just parsed as text. forummotion controller's probably does not allow this for security reasons.

I'm out of ideas. Does this have a solution?
darksshades
darksshades
New Member

Posts : 4
Reputation : 1
Language : Brazilian

https://www.forumotion.com/

Back to top Go down

In progress Re: Link image preview meta tag for each thread

Post by SLGray April 16th 2020, 10:52 pm

I mean a link to an official Discord page that gaves the coding and how to use it.


Link image preview meta tag for each thread Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51493
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: Link image preview meta tag for each thread

Post by darksshades April 17th 2020, 2:42 am

SLGray wrote:I mean a link to an official Discord page that gaves the coding and how to use it.

Sorry, I'm not sure I'm understanding you. Discord follows the standard open graph protocol and it is working as it should.
The problem lies that phpbb by default uses a static og:image(the blue textbubble icon) meta tag and I'd like it to use the first image of the post as the og:image meta tag instead for better sharing visualization.
It's not ideal for me to see the same image over and over for all the links when sharing on a platforms like discord, telegram, etc, that uses ogp. A more relevant image to the link would be desireable.

There are several phpbb extentions that solves this need but I understand that forummotion does not allow that.
I only created this thread on the slim chance that there was a feature like that here somewhere and I just didn't know where.

Anyways, thanks for the response.

PS: Just for reference here are some of the extensions that have this feature
https://www.phpbb.com/customise/db/extension/seo_metadata
https://github.com/LotusJeff/socialshare
https://github.com/AlfredoRamos/phpbb-ext-seo-metadata
https://github.com/LotusJeff/phpbb-facebook-twitter-tags

darksshades
darksshades
New Member

Posts : 4
Reputation : 1
Language : Brazilian

https://www.forumotion.com/

Back to top Go down

In progress Re: Link image preview meta tag for each thread

Post by SLGray April 17th 2020, 3:34 am

Usually that is how it is done on other social media platforms already.  Have you tried to share a topic from your forum that has an image?


Link image preview meta tag for each thread Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51493
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum