Facebook打开图表单页应用程序 [英] Facebook Open Graph Single Page Apps
问题描述
以下SO问题似乎提供了一种有趣的方法来为动态内容提供物理开放图形网址:
其他开发人员如何使用开放图表
您可以让服务器输出动态内容,但您仍然可以需要一个不同的url为每个对象,因为这是Facebook如何索引这些对象。
然而,你可以做的是使用url的querystring或片段部分来识别它。
所以,假设你有一个页面,你想要提供所有的打开的图形对象: your-domain.com/og 现在你可以添加到这样的标识符: p>
your-domain.com/og?type=3&id=432543643
your-domain.com/og#type = 653& id = 46t43g3
your-domain.com/og?type=25id=4tn4g43#anotherstring
I have built a single page application using backbone js. I have separate backbone url "routes" for various application states and dynamic content (e.g. books), but essentially Facebook will only ever see the index page.
The following SO question seems to provide an interesting approach to providing physical open graph URLs for dynamic content:
Multiple Facebook opengraph objects on the same page
How have other developers approached using open graph tags on dynamic pages, specifically in single page apps?
You can have the server output dynamic content for this, but you still need a different url for each object since this is how facebook index those objects.
What you can do however, is use the querystring or fragment parts of the url to identify it. So, let's say you have a single page that you want to serve all the open graph objects: your-domain.com/og now you can add to it identifiers like this:
your-domain.com/og?type=3&id=432543643
your-domain.com/og#type=653&id=46t43g3
your-domain.com/og?type=25id=4tn4g43#anotherstring
这篇关于Facebook打开图表单页应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!