为什么FB共享者只使用主页上的OG元标记详细信息? [英] Why does FB sharer use only the OG meta tag details on the home page?

查看:143
本文介绍了为什么FB共享者只使用主页上的OG元标记详细信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,编码在codeigniter,这基本上是不同用户的帖子的集合。在添加fb共享按钮并单击它时,图像,标题和描述内容是从主页标题而不是分享按钮放置的页面(视图)的标题?

I have a project, coded on codeigniter, which is basically a collection of posts by different users. While adding the fb share button and clicking on it, The image, title and description content is taken from the header of the home page and not of the page(view) where the share button is placed?

推荐答案

如上所述此处< a>,问题是,只有那些用户可以查看已登录的页面,因此即使fb也无法从那里抓取信息。

As mentioned here, The issue was that only those users could view the page who are signed in, and therefore even fb wasn't able to scrape the info from there.

编辑:这里重要的是FB如何抓取信息。显示在FB解析时在data-href中提供的链接,它们从该页面的标头捕获og元标记。但是,如果您将这些页面限制为已登录用户,则FB也无法解析该页面,因此会将其还原为基本URL的元标记。

Whats important here is how FB scrapes the info. Apparantly the link you provide inside data-href if parsed by FB and they capture the og meta tags from the header on that page. However if you restrict those pages to logged in users, FB is also unable to parse the page and thus it reverts to the base URL's meta tags.

这篇关于为什么FB共享者只使用主页上的OG元标记详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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