限制 Facebook 分享中的缩略图数量
所以我希望用户能够在 facebook 上共享此链接,但我只希望特定的图片作为此共享图片的缩略图,并且我的网站上没有其他图像出现
我阅读了有关 facebook 共享的文档,我得到了这个
< a href="http://developers.facebook.com/docs/share" rel="nofollow noreferrer">http://developers.facebook.com/docs/share
基本上我的理解是
<link rel="image_src" href="thumbnail_image" / >
应该这样做我想要什么。但是,我无法让它发挥作用。我的网站是使用 Rails 进行编程的,在布局内部,我有上面的标签来接收来自模型实例的图像 url。
有谁知道如何正确使用这个?我是否误解了这个标签?我想禁止用户选择页面上的图像,只允许用户共享我必须指定的 1 个图像。
So I want users to be able to share this link on facebook but I want only a specific picture to be the thumbnail for this sharing picture and no other images that appear on my web site
I read the documentation about facebook share and I got this
http://developers.facebook.com/docs/share
Basically what I understand is that
<link rel="image_src" href="thumbnail_image" / >
should do what I want. However, I cannot get this to work. My site is programmed using rails and, inside the layout, I have the above tag to take in an image url coming from a model instance.
Does anyone know how to use this properly? Am I misunderstanding something about this tag? I want to disable user from selecting through the images that I have on my page and just allow the user to share with only 1 image which I have to specify.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要指定特定图片,您需要向页面添加开放图元标记。看看http://developers.facebook.com/docs/opengraph/。
您的案例的开放图标签是:og:image
To specify a specific picture you will need to add open graph meta tags to your page. Take a look at http://developers.facebook.com/docs/opengraph/.
The open graph tag for your case is: og:image