打开图形元标记

Lou*_*ton 4 facebook meta-tags facebook-opengraph

我使用Facebook应用程序(shortstack)来制作我的页面.我希望在与短网址共享时个性化发布.我测试创建一个开放的图形元标记,但它不起作用.

Nic*_*nié 6

您需要在页面中添加opengraph元标记

<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."/>
Run Code Online (Sandbox Code Playgroud)

示例在此处找到http://developers.facebook.com/docs/opengraphprotocol/

您还需要将顶部标记更改为

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:og="http://ogp.me/ns#"
  xmlns:fb="http://www.facebook.com/2008/fbml">
Run Code Online (Sandbox Code Playgroud)

然后它应该工作正常:)

要调试页面并查看是否正确实现了opengraph标记,请使用调试工具:http://developers.facebook.com/tools/debug/

希望有所帮助