我喜欢的 Facebook 插件 - 它在哪里获取有关标题/描述/照片的信息?
当我在带有 facebook 插件的网站上输入“我喜欢”时,我会在 Facebook 上看到该页面的标题、描述、图像等等...
如果我尝试将插件放在我的网站上并做一个“我喜欢”,我只能看到主页上的标题,仅此而已!
我需要在哪个标签上插入图像路径、描述和自定义标题? 实际上,我的文档类型是:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
所以,不是 HTML5 页面。
When I do an "I Like" on a website with the facebook plugins, I see on Facebook there is the Title of that page, a description, an image, and so on...
If I try to put the plugins on my website and do an "I Like", I can only see title on of the main page, nothing more!
On which tag need I to insert the image path, description, and a custom title?
Actually, my doctype is :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
so, not an HTML5 page.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该阅读开放图协议。
本质上,您需要在页面上嵌入一些
og:tags
,以便 Facebook 知道在预览类似操作时要显示哪些信息。这些标签应放置在您的
head
标签内,它们看起来像这样:不要忘记用您自己的值替换那里的值。
如果您在选择使用哪些标签或使用哪些值时遇到困难 - 您应该查看 Facebook 为我们提供的这个很棒的工具:
Facebook 的 URL 调试器
该工具将向您准确显示 Facebook 如何查看您的网址,并且还会提醒您
og:tags
可能出现的任何错误。Be aware of the caching that Facebook does of your tags :
Taken from the Open Graph Documentation
You should readup on the Open Graph Protocol.
Essentially you'll need to embed some
og:tags
onto your page so that Facebook can know what information to display for the preview of the like action.The tags should be placed within your
head
tag and they look something like this :Don't forget to substitute the values there for your own values.
If you are having difficulties in choosing what tags to use or what values to use - you should check out this great tool that Facebook has provided us :
Facebook's URL Debugger
This tool will show you exactly how Facebook views your URL and it will also alert you to any errors that you might have with your
og:tags
.Be aware of the caching that Facebook does of your tags :
Taken from the Open Graph Documentation