Facebook Open Graph和Metatags [英] Facebook Open Graph and Metatags

查看:341
本文介绍了Facebook Open Graph和Metatags的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 https://developers.facebook.com/tools/debug



我添加了 locale metatag,因为我有很多外部属性错误。但是这不能解决它。

 外部属性:此类型的对象不允许名为og的属性:latitude 
外部属性:此类型的对象不允许名为og:longitude的属性。
外部属性:此类型的对象不允许名为og:region的属性。
外部属性:此类型的对象不允许名为og:street-address的属性。
外部属性:此类型的对象不允许名为og:locality的属性。
外部属性:此类型的对象不允许名为og:postal-code的属性。
外部属性:此类型的对象不允许名为og:country-name的属性。
外部属性:此类型的对象不允许名为og:email的属性。
无关属性:此类型的对象不允许名为og:phone_number的属性。
外部属性:此类型的对象不允许名为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是<!DOCTYPE html PUBLIC - // W3C // DTD XHTML + RDFa 1.0 // ENhttp://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd>



我已经检查过此线程 Facebook Open Graph locale对于澳大利亚和此对象调试器给我opg的属性和推断属性错误



但是我仍然有无关性错误



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



Edit2:我有:

 < meta property =og:typecontent =company/>但是Facebook说: https://graph.facebook.com/10150616664862786  



类型:网站
???



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

解决方案

这是因为即使你指定了og:type = linter显示您的类型是网站,您尝试使用的属性不适用于网站对象类型。这个这里有一个公认的答案。你真正的问题是,linter正在读取og:错误地输入。


I have the following output at https://developers.facebook.com/tools/debug

I added the locale metatag, because I had a lot of Extraneous Property errors. But that does not solve it.

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.

I also have the namespaces in the <html> tag:

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

I have also tried xmlns:fb="https://www.facebook.com/2008/fbml" as suggested here: https://developers.facebook.com/docs/opengraph/

My doctype is <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">

I have checked this thread Facebook Open Graph locale for Australia and this Object Debugger gives me Extraneous Property And Inferred Property error on opg

But I still have the Extraneous Property error

Edit: I used this documentation: https://developers.facebook.com/docs/opengraph/#extra-data When I browse to the namespace definition of open graph, I don't see the latitude and longtitude options, but Facebook's documentation does recommend it. But the debugger of Facebook does not accepts it. I am missing something here...

Edit2: I have:

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

but Facebook says: https://graph.facebook.com/10150616664862786

type: website ???

Why does Facebook see a different type? And how do I fix this?

解决方案

This is because even though you have specified og:type=company, the linter is showing that your type is website, and the properties you are trying to use are not applicable for a website object type. There is an accepted answer for this here. Your real problem is that the linter is reading og:type incorrectly.

这篇关于Facebook Open Graph和Metatags的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆