开放图形协议 - 如何使它与一个页面上的多个故事一起工作? [英] Open Graph Protocol - how to make it work with multiple stories on a page?

查看:85
本文介绍了开放图形协议 - 如何使它与一个页面上的多个故事一起工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

开放图谱协议是一种新的存储元数据的方法,使第三方网站变得更加轻松(想想Facebook LIKE按钮)来识别页面上的相关内容。



它看起来像这样:

 < title> The Rock(1996)< / title> 
< meta property =og:titlecontent =The Rock/>
< meta property =og:typecontent =movie/>
< meta property =og:urlcontent =http://www.imdb.com/title/tt0117500//>
< meta property =og:imagecontent =http://ia.media-imdb.com/images/rock.jpg/>

问题是,如果页面上有多个LIKE按钮,是否区分属于文章的Open Graph元标记,而不是页面本身。由于标签进入HEAD,看起来您只能在每页获得一个集合。



Open Graph可以是名称空间还是与页面内的内容相关联,而不是页面本身?

解决方案

据我所知,你被卡住了 - 但如果你找出方法,让我知道!

我在一个需要在一个页面上放置多个Open Graph标签的项目上工作 - 最后,我们最终削减了我们需要的OG项目的数量,这样我们只能在一个页面上看到一个故事。


The Open Graph Protocol is a new methodology for storing metadata to make it easier for third party sites (think the Facebook LIKE button) to identify relevant content on your page.

It looks like this:

<title>The Rock (1996)</title>
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="movie" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />

The question is, if you have multiple LIKE buttons on a page, each for a different article, how does one differentiate the Open Graph meta tags that belong to the article, not the page itself. Since the tags go in the HEAD is seems you only get one set per page.

Can Open Graph be "namespaced" or associated with content within the page, rather than the page itself?

解决方案

As far as I know, you're stuck - but if you figure out a way, let me know!

I worked on a project that needed to have multiple Open Graph tags on a page - in the end, we ended up trimming down the number of items we needed OG for, so that we'd only have one story on a page.

这篇关于开放图形协议 - 如何使它与一个页面上的多个故事一起工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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