2012-04-16 62 views
4

我使用Facebook应用程序(shortstack)来制作我的页面。 我想在个人化发布时与短网址分享。 我有测试创建一个开放的图元标签,但它不工作。打开图片元标记

回答

6

你需要把opengraph meta标签在你的页面一样

<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."/> 

例子在这里找到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"> 

然后它应该工作正常:)

调试您的网页,看看你是否rrectly实施opengraph标签使用调试工具在这里:http://developers.facebook.com/tools/debug/

希望帮助

+1

谢谢您的效应初探它是为我好 – 2012-04-30 22:36:48

+0

对于简单的测试,您可以粘贴HTML片段,并使用该工具的http网上发布:/ /www.golery.com/posthtml然后尝试与facebook debgger developers.facebook.com/tools/debug 请注意,Facebook缓存图像,所以你需要问问facebook调试器刷新几次。 – greensuisse 2017-06-06 20:21:37