这是怎么回事用"数据:post.url","数据:post.title&QUOT ;,等 [英] What's the deal with "data:post.url", "data:post.title", etc

查看:816
本文介绍了这是怎么回事用"数据:post.url","数据:post.title&QUOT ;,等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

会有人这么好心来解释这个数据对象是什么(如果它是一个对象),如果有任何文件就可以了。

Would someone be so kind as to explain what this data object is (if it is an object) and if there is any documentation on it.

我添加社交分享按钮的应用程序和决定,我希望把共享到Blogger按钮在那里,只是为了好玩。我找不到一个网页,有一个官方的份额到Blogger按钮,像Fac​​ebook有喜欢按钮,或Twitter,一个鸣叫按钮的官员。什么我发现是这样的职位上添加共享按钮,一个博客与连接的文本文件。我注意到大多数,如果不是所有的HTML标签中使用数据:post.url'和'数据:post.title动态抓取博客文章的网址和标题

I was adding social sharing buttons to an app and decided I wanted to put a share to Blogger button on there, just for the fun of it. I could not find a page that had an official 'share to Blogger' button, like Facebook has an official 'like' button, or Twitter, a 'tweet' button. What I did find was this post on adding sharing buttons to a blog with the attached text file. I noticed that most, if not all of the html tags use the 'data:post.url' and 'data:post.title' to dynamically grab the URL and title of the blog post.

例如:

<a expr:href='&quot;http://reddit.com/submit?url=&quot; + data:post.url + &quot;&amp;title=&quot; + data:post.title' target='_blank' title='Share On Reddit !'><img alt='Share On Reddit !' src='http://1.bp.blogspot.com/_YUvD9j84Cik/TBvM2-Sw3ZI/AAAAAAAAAHk/QKghefISkNc/reddit.gif' style='width:16px; height:16px; padding:0; border:0; vertical-align:middle;'/></a> 

<a expr:href='&quot;http://www.blogger.com/blog_this.pyra?t&quot; + &quot;&amp;u=&quot; + data:post.url + &quot;&amp;n=&quot; + data:post.title + &quot;&amp;pli=&quot; + 1' target='_blank' title='Post To Blogger !'><img alt='Post To Blogger !' src='http://1.bp.blogspot.com/_YUvD9j84Cik/TBvMqnnrVtI/AAAAAAAAAG8/O65EnRFSHFk/blogger.gif' style='width:16px; height:16px; padding:0; border:0; vertical-align:middle;'/></a> 

<a expr:href='&quot;http://www.friendfeed.com/share?link=&quot; + data:post.url + &quot;&amp;title=&quot; + data:post.title' target='_blank' title='Share On Friend Feed !'><img alt='Share On Friend Feed !' src='http://1.bp.blogspot.com/_YUvD9j84Cik/TBvMxcy7H8I/AAAAAAAAAHU/UfNllYiyznA/friendfeed.gif' style='width:16px; height:16px; padding:0; border:0; vertical-align:middle;'/></a> 

当寻找到这个StackOverflow上,我发现,我们建议使用人<一个href=\"http://stackoverflow.com/questions/7403310/the-same-facebook-comments-appear-on-every-post-on-blogger/8581433#8581433\">social评论和<一个href=\"http://stackoverflow.com/questions/16714662/share-buttons-share-homepage-instead-of-actual-page/17623313#17623313\">share 谁正与分享他们的网址问题的按钮,不过,值得注意的是,没有一个答案已经被标记为正确。

When looking into this on stackOverflow, I've found that it is suggested for people using social comments and share buttons who are having issues with sharing their URLs, though, it is notable that none of the answers have been marked correct.

这是不是被严格限制于在Blogger / Blogspot的平台,或者是它的东西是由浏览器来处理?我一直没能找到在DOM任何引用数据或交。我很想知道如何可以更广泛地使用,它是否应该在所有被使用。

Is this something that is strictly limited to the Blogger/Blogspot platforms, or is it something that is handled by the browser? I haven't been able to find anything in the DOM referring to data or post. I'd be interested to know how this can be used more broadly and if it should be used at all.

推荐答案

在这种情况下,数据:是作用域可以包括可从博客的数据的命名空间在模板。一个什么样的速效权威名单这里

In this case, data: is a namespace that scopes the data available from Blogger that can be included in a template. The authoritative list of what's availabe is here.

这是博客为中心的。

其他的命名空间是 B 这与布局和控制流,而 expr的交易:哪些键发动机到一个事实,即标签从Blogger中涉及到的数据(如你有以上)。

The other namespaces are b: which deals with layout and control flow, and expr: which keys the engine into the fact that the tags involve data from Blogger (as you have above).

有一个很好的教程是这里

这篇关于这是怎么回事用&QUOT;数据:post.url&QUOT;,&QUOT;数据:post.title&QUOT ;,等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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