8

当我单击 AddThis Pinterest 按钮时,该框会在屏幕中间打开,提供来自我页面的各种图像。凉爽的。但是,其中提供的有导航按钮、横幅广告和其他相关图像的颗粒状、放大部分。同样,收藏夹栏 PinIt 按钮(来自 Pinterest 本身)的页面“正确”,这意味着它只提供有意义的图像;不包括导航按钮。

如何从 AddThis Pinterest 小部件框中排除选定的图像?

提前感谢任何可以提供帮助的人。

4

3 回答 3

4

强制图像的实际方法是“媒体”选项,而不是“网址”选项:

<a... pi:pinit:media='http://path/to/my/image.jpg'>...</a>
于 2012-11-26T06:06:50.137 回答
3

AddThis Pinterest 支持图像的“at_include”和“at_exclude”类。

全文在这里:http: //support.addthis.com/customer/portal/articles/1300322-pinterest-image-sharing#.UuAnmrvTm2x

包括图像

您可以使用“image_include”配置选项指示共享预览仅从页面中抓取特定图像。首先,将 image_include 设置为您想要的类名(不允许使用 id 选择器,只能使用类选择器),然后将相同的类名添加到页面上应该抓取的每个图像中。对于 image_include,不要添加 '.' 选择器。这是一个例子:

<script type="text/javascript">
var addthis_config = {
image_include: "at_include"
}

使用类定义 image_include 后,将该类添加到页面上所需的图像中。在此示例中,页面上将被抓取的唯一图像将是具有 at_include 类的图像(img1.jpg 和 img3.jpg)。

<img src="http://www.example.com/img1.jpg" class="at_include" />
<img src="http://www.example.com/img2.jpg" />
<img src="http://www.example.com/img3.jpg" class="at_include" />

排除图像

您可以使用 image_exclude 配置选项指示共享预览忽略页面中的特定图像。首先,将 image_exclude 设置为您想要的类名(不允许使用 id 选择器,只能使用类选择器),然后将相同的类名添加到页面上应忽略的每个图像中。对于 image_exclude,不要添加 '.' 选择器。这是一个例子:

<script type="text/javascript">
var addthis_config = {
image_exclude: "at_exclude"
}

使用类定义 image_exclude 后,将该类添加到页面上所需的图像中。在此示例中,页面上唯一将被抓取的图像将是没有 at_exclude 类 (img2.jpg) 的图像。

<img src="http://www.example.com/img1.jpg" class="at_exclude" />
<img src="http://www.example.com/img2.jpg" />
<img src="http://www.example.com/img3.jpg" class="at_exclude" />

图像容器

您还可以指示共享预览从特定容器中抓取图像,例如包含在类或具有 Pinterest 共享按钮的 ID 中的所有图像。如果页面上有多个 Pinterest 分享按钮,这将非常有用。请记住,Pinterest 共享按钮必须位于图像所在的同一容器中。另外,请注意 image_container 需要有 '.' 或“#”选择器。这是一个例子:

<script type="text/javascript">
var addthis_config = {
image_container: ".shared_content"
}

使用类定义 image_container 后,将该类添加到页面上所需的类。在此示例中,页面上将被抓取的唯一图像将是包含在 shared_content 中的图像。

<div class="shared_content">
Here's some example text. Images in this div will be grabbed.
<img src="http://www.example.com/img1.jpg" />
<img src="http://www.example.com/img2.jpg" />
<a class="addthis_button_pinterest_share"></a>
</div>

<div class="another_div">
Here's some more example text. Images in this div will not be grabbed.
<img src="http://www.example.com/img3.jpg" />
<img src="http://www.example.com/img4.jpg" />
</div>
于 2014-01-22T20:21:31.177 回答
1

如果要指定单个图像供 Pinterest 使用,则必须将该图像的路径指定为pi:pinit:url属性值。

<a... pi:pinit:url='http://path/to/my/image.jpg'>...</a>
于 2012-08-02T20:58:06.677 回答