Facebook打开图表元属性og:“网站”的类型。属性'object-name'需要一个og对象:type'object-name' [英] facebook open graph meta property og:type of 'website'. The property 'object-name' requires an object of og:type 'object-name'

查看:495
本文介绍了Facebook打开图表元属性og:“网站”的类型。属性'object-name'需要一个og对象:type'object-name'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在蛋糕php 1.3在视图ctp我有以下代码:

in cake php 1.3 in view ctp i have follow code:

$url = 'http://example.com/exmp/explus/books/view/'.$book['Book']['id'];

echo $this->Html->meta(array('property' => 'fb:app_id', 'content' => '*******'),'',array('inline'=>false));

echo $this->Html->meta(array('property' => 'og:type', 'content' => 'book'),'',array('inline'=>false));

echo $this->Html->meta(array('property' => 'og:url', 'content' => $url ),'',array('inline'=>false));

echo $this->Html->meta(array('property' => 'og:title', 'content' => $book['Book']['title']),'',array('inline'=>false));

echo $this->Html->meta(array('property' => 'og:description', 'content' => $book['Book']['title']),'',array('inline'=>false));

$imgurl = '../image/'.$book['Book']['id'];

echo $this->Html->meta(array('property' => 'og:image', 'content' => $imgurl ),'',array('inline'=>false)); ?>

,当我发布它时,它会出现以下错误

and it gives the following error when i am posting it'

{
   "error": {
      "message": "(#3502) Object at URL http://example.com/exmp/explus/books/view/234'   has   og:type of 'website'. The property 'book' requires an object of og:type 'book'. ",
      "type": "OAuthException",
      "code": 3502
   }
}

如何解决?

推荐答案

如果您的页面受限于登录用户或具有某种会话逻辑,则可能会出现此问题

This issue can occur if your page is restricted for logged in users or has some sort of session logic.

您可以使用此链接中的调试工具:

You can use the debug tool from this link :

http://developers.facebook.com/tools/debug

在那个链接可以提供您的网址( http://example.com/exmp/explus/books/视图/ 23 4

In that link you can give your url (http://example.com/exmp/explus/books/view/234) in the "Input URL, Access Token, or Open Graph Action ID" Field.

>之后点击调试按钮,如果你能够看到 fb:app_id,og:url,og:type,og:title 的值,这个问题不会发生。

After that on clicking the debug button if you are able to see the values for fb:app_id,og:url,og:type,og:title , this issue would not occur.

否则,您可以在页面底部查看URL部分,然后点击查看我们的刮刀在您的网址中看到的内容 link.On点击链接,您可以在浏览器中看到您的网站的HTML代码。这将帮助您调试问题。

Else you can check the "URLs" section at the bottom of the page and click the "See exactly what our scraper sees for your URL" link.On clicking the link you can see the html code of your site in the browser. That will help you to debug the issue.

这篇关于Facebook打开图表元属性og:“网站”的类型。属性'object-name'需要一个og对象:type'object-name'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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