2014-12-05 52 views
0

我想使用addThis工具箱在頁面上的多個項目。我一直在閱讀,我需要使用addthis:url屬性來生成單個項目的正確URL。AddThis工具箱多個項目

我有如下:

<!-- Go to www.addthis.com/dashboard to customize your tools --> 
    <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-535e7a2916e104ff" async="async"></script> 

    <!-- Go to www.addthis.com/dashboard to customize your tools --> 
    <div class="addthis_sharing_toolbox" style="margin-bottom:20px;" addthis:title="THE TITLE" addthis:description="THE DESCRIPTION" addthis:url="<?php echo $this->item->link; ?>"></div> 

這似乎並不做任何事情?它只能在div中響應,但實際上並沒有改變該份額,因此它對於該項目是特定的。

任何想法?

感謝

+0

我覺得你在src的javascript代碼中缺少路徑看起來像是被破壞 – 2014-12-05 13:47:48

+0

不,路徑是正確的。這是您在其網站上創建時生成的代碼。它也適用於單獨的頁面。 – user2713512 2014-12-05 13:51:23

回答

1

的前頁:標題,前頁:描述和前頁:URL參數是與我們的舊的先進配置工具使用 - 裏面的按鈕代碼的人。

對於這個與您需要使用此代碼addthis_sharing_toolbox工作:

<!-- Go to www.addthis.com/dashboard to customize your tools --> 
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-535e7a2916e104ff" async="async"></script> 

<!-- Go to www.addthis.com/dashboard to customize your tools --> 
<div class="addthis_sharing_toolbox" style="margin-bottom:20px;" data-title="THE TITLE" data-url="<?php echo $this->item->link; ?>"></div> 

此外,您只需要擁有addthis_widget.js一次在每一頁上。這個位置通常並不重要(除非頁面上的其他JavaScript存在某種競爭條件),但您不應該多次使用它,因爲它會減慢頁面加載速度。

+0

謝謝保羅。 你會如何包含說明? – user2713512 2014-12-05 17:21:26

+0

幾乎沒有我們支持的服務添加說明。您是否有特定的服務要共享給您要包含的說明? – Paul 2014-12-08 14:31:35

+0

不要忘記。我只是認爲這也是一個重要的參數。別擔心 ;-) – user2713512 2014-12-08 17:50:53