设置AddThis模块以适用于所有页面

时间:2013-03-13 09:51:50

标签: php magento module addthis

我已经为Magento安装了AddThis模块。

但此扩展仅适用于产品页面。您知道如何设置共享按钮以显示在所有页面上吗? 我搜索了所有的源代码,但没想出设置只出现在产品页面上的位置。

所以我猜问题可能来自app / design / frontend / default / default / template / addthis / sharingtool / share.phtml 在这个页面加载了一些javascript代码。 任何建议都会有所帮助。

1 个答案:

答案 0 :(得分:0)

我找到了解决方案:

<强> 1。我的解决方案:

转到:app / code / community / AddThis / SharingTool / Model / Observer.php

改变这个:

  if ($block->getNameInLayout()=='product_review_list.count') {

对此:

  if (strstr($block->getNameInLayout(),'search')) {

(因此,添加此共享按钮将显示在包含搜索选项的所有页面上)

2 。我也通过电子邮件发送了addthis官方支持,答案是:

  

您可以在任何CMS或.phtml文件中添加共享按钮。

2.1对于cms页面,您可以使用

{{block type="sharingtool/share" name="addthis_sharetool"}}

2.2在任何phtml文件中,您都可以使用

<?php
echo $this->getLayout()->createBlock('sharingtool/share')->setBlockId('addthis_sharetool')->toHtml();
?>

以下是支持文档。 http://support.addthis.com/customer/portal/articles/381234-addthis-for-magento