将Facebook'share'metatag添加到drupal

时间:2012-07-16 13:04:07

标签: php facebook drupal drupal-7 drupal-modules

我是drupal的新手,我需要知道我是否可以使用元标记添加共享按钮。要求是为其旁边的每个链接显示链接列表和共享按钮。这应该共享链接中给出的页面。这可能吗?如果是这样,怎么样?我现在可以使用<fb:like></fb:like>标记添加类似按钮。谷歌搜索没有多大帮助。仅供参考,我使用drupal 7。

谢谢, Ananth。

2 个答案:

答案 0 :(得分:3)

如果您要在drupal 7页面中添加元标记,则应使用drupal_add_html_head()

以下是添加说明元标记的示例。

drupal_add_html_head(array(
    '#tag'          => 'meta',
    '#attributes'   => array(
        'property'  => 'description',
        'content'   => 'this is my description tag',
    )), "YOU_KEY");

希望这有帮助......穆罕默德。

答案 1 :(得分:0)

我相信,这非常可行。 如果您的链接是“http://www.google.com” 并且您想在FB上分享此URL,此链接将帮助您建立链接 http://developers.facebook.com/docs/reference/plugins/like/

同样适用于Google plus - https://developers.google.com/+/plugins/+1button/ Twitter按钮 - twitter.com/about/resources/buttons

您需要传递每个标记的URL,它与您正在构建的链接相同。