2011-12-12 69 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,其中沒有一個是公司的。

相關問題