News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Links to forum on facebook show no thumbnails or images

Started by Janden, April 20, 2013, 02:43:50 AM

Previous topic - Next topic

Arantor

-sigh- I guess I need to explain it in yet more detail from my previous post.

This site doesn't use any mods. It just so happened that on the one page you tried, there is a picture that FB happened to find that was within the rules it has.

Try it from a regular thread page, the only things it'll pull up, if it pulls anything up are the logo as on the page and the avatars. Though frequently it won't get those either.

Janden

So how did it work from the this forum's main page? I'm sorry, but none of this is making any sense to me.

Arantor

You put the link in. Facebook visits the page. It looks for any images it can find. If it finds any it can use, it will provide them.

It just happened to find one image that was within its criteria.

As in, you put in http://www.simplemachines.org/ and of all the images, all it found was that image in the middle of the page. Not the smaller images like the star or the paint roller, or the site logo for that matter. Just that one image in the middle of the page.

Janden


Kindred

http://wiki.simplemachines.org/smf/How_can_I_install_a_mod_that_doesn%27t_work_in_my_SMF_version

and - if there is an og tag defining a site image, it will be used...  so - yes, it adds the like button, but since the OG tag is present it will be used even with a pasted link. (probably - facebook changes their interface regularly and sometimes without major notice)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

AZMazda3

Sorry for posting on an old thread, but I want to add that since last this was started SMF has been updated there are many things different with 2.0.7 and Facebook OG. I have been searching this community for others on how they easily added OG tags for FB without a mod, and keep coming to this thread. Other than explaining what OG and Facebook does in a way, I haven't found an answer.

I do not want to add anything but the ability to post links on FB and pull up pertinent links and info, and images. None of the mods will just do this. I don't want FB logins, and do not need a 'Like" button. I just want to add the metatags and have the ability to change them when I want.

So IF anyone has done this, please share how they did it.

DBCoop

i've been searchig all day for the same anwswer.. I am posting a link to friends on Facebook of my webforum and the image it uses to display on facebook is an ad-banner and not the forum logo. I tried finding meta tag option in the forum settings to no avail, and Ive searched the forums and mods thoroughly for an answer but all of them are invalid, or out of date and not compatible with 2.0.7

looking for an answer to add OG meta tags to my SMF forum.. Any help would be great! thanks

Kindred

you would have to use one of the facebook mods... or edit your index.template.php to add the og tag directly
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

iulian X

Quote from: Janden on April 20, 2013, 02:43:50 AM
This might seem like a silly question, but I know people on FB click on more things that have pretty pictures. What I've noticed is that any time I like to my forum, either the forum itself or a certain topic, FB only displays the link. It would be cool if there was a way to make it show something, an icon or a logo, anything. Does anyone know how to do this?

A simple solution to this problem.
Add a picture in the message and set the picture to be very small.
[img width=6 height=4]http://domain/picture.png[/img]

Paste the link here to fefresh facebook image cache
https://developers.facebook.com/tools/debug/

Kindred

That, however, requires you to manually add a picture to EVERY POST...  that is not really a sustainable way to do things....

The proper way to do it is to add the OG tags.

Using a mod is the best way (I have no idea why some people are so obsessed with "give me a way that is not a mod" (what do you think your MANUAL changes are other than an undocumented mod? At least, with a mod, you have a clear record of what changes were made.)
There are several mods, at this point, which properly add the OG tags.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

crimpson

#30
I have the answer!

Make your logo image 1,200 x 627 and put it wherever you like in your website directory.
use facebooks sharing debugger and OG debugger tools https://developers.facebook.com/tools/debug/sharing/
and https://developers.facebook.com/tools/debug/og/object
enter in your website url when you're ready to test.

The file you want to edit is in /Themes/yourcurrenttheme/index.template.php
scroll to the bottom of the head, the last line before it ends.
You need to add facebooks "meta og" tags that point to the image and description you wish to use.

This is what it looks like.

<link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0" />';

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'];

echo '

<meta property="og:image" content="http://www.yourwebsite.com/fblogo.jpg" />
</head>
<body>';

There will be other "link rel=" tags above that.
This is where you can put all of your facebook OG tags for website description, image' whatever.
Here's all the OG tags: http://ogp.me/
Any time you make changes to the OG tags or your preview image, you need to tell facebook to "fetch new scrape information" using their debugger tools. I'm sure there's lots of ways you can use these tags, for example: It's probably possible to point the image tag at a directory instead of one particular image, or multiple image tags to choose from. haven't played with this yet.

Advertisement: