从Google +1按钮分享时指定图片 [英] Specify image when sharing from Google +1 button

查看:97
本文介绍了从Google +1按钮分享时指定图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此链接中,我学会了为Google +1按钮指定网址。

In this link, I have learned to specify a URL for the Google +1 button.

指定自定义URL到gplus一个按钮

我还可以指定特定图像吗?

Can I also specify a specific image?

已编辑

我不需要更改Google plus按钮gif或Google plus按钮的背景。我需要指定用户想要在社交网络中分享的图像。

I don't need to change the Google plus button gif or the background of the Google plus button. I need specify the image that a user want to share in social network.

可以吗?

推荐答案

是的,这是可能的。

你的意思是你要指定一个图像,该图像将显示在由在Google+上分享。 +1按钮有两个功能:1)点击时会为点数添加+1,2)可选择允许用户将您的网址分享给Google+并对其进行评论。

What you mean is that you want to specify an image that will show up in the snippet that is generated by sharing on Google+. The +1 button does two things: 1) It adds a +1 to the count when clicked, and 2) optionally it allows a user to share your URL to Google+ and comment on it.

您所询问的是该互动的第二部分,并在 https://开发人员中进行了说明.google.com / + / plugins / snippet /

What you're asking about is the second part of that interaction and is documented at https://developers.google.com/+/plugins/snippet/

该页面有一个工具,可以帮助您生成需要插入到您的HTML中的HTML页。您还可以选择三种不同的方法来指定代码段信息。

That page has a tool that can help you generate the HTML you'd need to insert into your page. You can also choose from three different methods of specifying the snippet information.

使用schema.org标记的示例:

An example using schema.org markup:

<!-- Update your html tag to include the itemscope and itemtype attributes. -->
<html itemscope itemtype="http://schema.org/Article">

<!-- Add the following three tags inside head. -->
<meta itemprop="name" content="My Cool Article">
<meta itemprop="description" content="This is the greatest site ever">
<meta itemprop="image" content="http://example.com/mycoolimage.png">

这篇关于从Google +1按钮分享时指定图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆