【问题标题】:Facebook share button doesn't display Image and DescriptionFacebook 分享按钮不显示图片和说明
【发布时间】:2011-05-16 11:54:27
【问题描述】:

在 Facebook 分享按钮中,当我单击弹出窗口时,它没有显示图像和描述。可能是什么原因?

<fb:share-button class="meta">
    <meta name="medium" content="mult"/>
    <meta name="title" content="name of fan page"/>
    <meta name="description" content="description of fan page"/>
    <link rel="image_src" href="url to image location" />
    <link rel="target_url" href="http://facebook.com/Anti.Social.Development"/>
</fb:share-button> 

【问题讨论】:

    标签: facebook button share


    【解决方案1】:

    您需要使用Open Graph Protocol。正如他们网站上给出的,这里是一个电影页面的完整示例:

    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:og="http://ogp.me/ns#"
          xmlns:fb="http://www.facebook.com/2008/fbml">
      <head>
        <title>The Rock (1996)</title>
        <meta property="og:title" content="The Rock"/>
        <meta property="og:type" content="movie"/>
        <meta property="og:url" content="http://www.imdb.com/title/tt0117500/"/>
        <meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>
        <meta property="og:site_name" content="IMDb"/>
        <meta property="fb:admins" content="USER_ID"/>
        <meta property="og:description"
              content="A group of U.S. Marines, under command of
                       a renegade general, take over Alcatraz and
                       threaten San Francisco Bay with biological
                       weapons."/>
        ...
      </head>
      ...
    </html>
    

    如果您检查您的 w3c,您需要将 DocType 更改为 XHTML + RDFa

    【讨论】:

    • 你能给出一个完整的工作示例代码吗..请......它不适合我
    • 老实说,我真的不能再做任何样本了。您需要设置元属性(有些是强制性的 - 检查链接),然后在数据(在内容部分)填充数据,当他们共享指向您的页面的链接时,您希望显示在某人的个人资料中)。您是否查看了 Open Graph Protocol 网站?
    猜你喜欢
    • 1970-01-01
    • 2014-06-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多