2011-12-12 106 views
1

我在https://developers.facebook.com/tools/debug的Facebook的Open Graph和元标记

以下输出我加了locale元标记,因为我有很多的外来地产错误。但是这并不能解决问题。

Extraneous Property: Objects of this type do not allow properties named og:latitude 
Extraneous Property: Objects of this type do not allow properties named og:longitude. 
Extraneous Property: Objects of this type do not allow properties named og:region. 
Extraneous Property: Objects of this type do not allow properties named og:street-address. 
Extraneous Property: Objects of this type do not allow properties named og:locality. 
Extraneous Property: Objects of this type do not allow properties named og:postal-code. 
Extraneous Property: Objects of this type do not allow properties named og:country-name. 
Extraneous Property: Objects of this type do not allow properties named og:email. 
Extraneous Property: Objects of this type do not allow properties named og:phone_number. 
Extraneous Property: Objects of this type do not allow properties named og:fax_number. 

我也有在<html>标签的命名空间:

<html 
    xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:og="http://ogp.me/ns#" 
    xmlns:fb="http://ogp.me/ns/fb#"> 

我也曾尝试xmlns:fb="https://www.facebook.com/2008/fbml" 如下建议:https://developers.facebook.com/docs/opengraph/

我的文档类型是<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">

我已签这个线程Facebook Open Graph locale for Australia和这个Object Debugger gives me Extraneous Property And Inferred Property error on opg

但我仍然有外来地产错误

编辑:我用这个文档:https://developers.facebook.com/docs/opengraph/#extra-data当我浏览到的Open Graph的命名空间定义,我没有看到纬度经度和选项,但Facebook的文档确实会推荐它。但Facebook的调试器不接受它。我失去了一些东西在这里...

EDIT2:我:

<meta property="og:type" content="company" /> 

但Facebook表示:https://graph.facebook.com/10150616664862786

类型:网站 ???

为什么Facebook看到不同的类型?我该如何解决这个问题?

+0

你可以给你的网站的链接吗? – Abby

回答

1

这是因为即使您指定了og:type = company,linter显示您的类型是网站,并且您尝试使用的属性不适用于网站对象类型。有这个here接受的答案。你真正的问题是棉绒正在读取:输入错误。

+0

但公司是一个有效的类型。它在这里列出https://developers.facebook.com/docs/opengraph/#types –

+0

是的。但它显然不适合你,所以有些事情必须是错误的。你有这个错误信息的原因是因为type = website不能拥有这些属性。所以现在你需要一个答案,为什么看到类型的网站,而不是类型公司。如果您搜索,那么已经有三个或四个SO问题了。我所链接的是我第一次看到一个被接受的答案 – Abby

0

您还应该记得将namespace declaration添加到页面的标题和正文标记。

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xmlns:fb="https://www.facebook.com/2008/fbml"> 
    <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns# YOUR_NAMESPACE: http://ogp.me/ns/apps/YOUR_NAMESPACE#"> 
    <meta property="fb:app_id" content="YOUR_APP_ID" /> 
    <meta ... 

显然,更换YOUR_NAMESPACEYOUR_APP_ID与您的应用程序的设置。

1

Facebook的文档已过时(有很大的惊喜。)唯一允许的og:类型可以找到here,其中没有一个是公司的。