简体   繁体   English

是什么导致Blogspot中的Google+评论无法在某些页面上运行?

[英]What might be causing Google+ Comments in Blogspot not to work on certain pages?

I'm working on a blogspot custom template, and am adding compatibility with Google+ comments. 我正在开发Blogspot自定义模板,并正在增加与Google+评论的兼容性。

In order to do that, I've included the following tag in the template code to allow these kind of comments to be displayed in each post of the blog: 为了做到这一点,我在模板代码中添加了以下标记,以允许在博客的每个帖子中显示此类评论:

<div class='cmt_iframe_holder' expr:data-href='data:blog.canonicalUrl' expr:data-viewtype='data:post.viewType'/>

With this I've managed to present Google+ Comments associated to each blog post, but I've found out that this is not working with blog pages, and blog pages only. 有了这个,我设法呈现了与每个博客帖子相关的Google+评论,但是我发现这不适用于博客页面,并且仅适用于博客页面。

So far I've checked the template flow, and confirmed it is accessed correctly while presenting both blogs and pages. 到目前为止,我已经检查了模板流,并在显示博客和页面时确认可以正确访问它。 Proof is that, while examining the resulting HTML code, I can see this div element in both types of publication. 证明是,在检查结果HTML代码时,我可以在两种类型的出版物中看到此div元素。 The difference, though, is that in blog posts it has included the comments iframe , while the div element in the blog pages is empty. 不过,区别在于,博客文章中包含了注释iframe ,而博客页面中的div元素为空。 Here is an example: 这是一个例子:

Blog page: 博客页面:

<div class="cmt_iframe_holder" data-href="http://miblog.blogspot.com/p/who-am-i.html" data-viewtype="FILTERED_POSTMOD" id="undefined"></div>

Blog post: 博客文章:

<div class="cmt_iframe_holder" data-href="http://miblog.blogspot.com/2013/11/this-is-a-post.html" data-viewtype="FILTERED_POSTMOD" id="gpluscomments" style="some style">
  <iframe>...</iframe>
</div>

Both initial parameters, as included in the template, are correct in both pages and posts: 模板中包含的两个初始参数在页面和帖子中均正确:

  • expr:data-href translates into the URL of the post or page, which is correct in both cases. expr:data-href转换为帖子或页面的URL,在两种情况下都是正确的。
  • expr:data-viewtype translates into FILTERED_POSTMOD in both cases as well. 在这两种情况下, expr:data-viewtype转换为FILTERED_POSTMOD

I've searched for information related to the id='undefined' attribute obtained in the blog page cases, against the id='gpluscomments' tag obtained in posts, but so far I've had no luck. 我搜索的是与博客页面案例中获得的id='undefined'属性相关的信息,而不是帖子中获得的id='gpluscomments'标签,但到目前为止我还没有走运。 I'm pretty sure there is an error in the communication between the blog and Google+, but at least the parameters in the <div> tag, which seems to be the only input these comments have, look good, and are the same in both cases. 我敢肯定,博客和Google+之间的交流存在错误,但是至少<div>标记中的参数似乎是这些注释唯一的输入,看起来不错,而且两者都相同案例。

Why could I be obtaining this behavior? 为什么我会得到这种行为? What could I further test to figure it out? 我可以进一步测试以找出答案吗? Any ideas? 有任何想法吗?

Thanks in advance, and have a nice day! 在此先感谢您,祝您度过愉快的一天!

Erizo Erizo

I've kept researching this situation, and have come to realize that this is the same behavior that happens on blogspot pages using the original blogspot templates. 我一直在研究这种情况,并逐渐意识到这与使用原始Blogspot模板在Blogspot页面上发生的行为相同。

I guess this is Google's default behavior for the moment, then! 我想这是Google目前的默认行为!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 google +评论和javascript - google+ comments and javascript 更改和onchange在我的计算机上不起作用。 是什么原因造成的? - change and onchange don't work on my computer. what might be causing this? 与Google+共享不起作用 - Sharing to Google+ doesn't work Google+ CreateActivity返回某些帐户的“ 401未经授权” - Google+ CreateActivity returning “401 Unauthorized” for certain accounts Google+反馈系统的屏幕截图部分如何运作? - How does the Screenshot part of the Google+ Feedback system work? 在响应式网站上使用Google+评论时,如何解决视口宽度问题? - How to fix viewport width issue when using Google+ comments on responsive website? 加载资源失败:服务器在向我的网站添加 google+ 评论时以 404 () 状态响应 - failed to load resource: the server responded with a status of 404 () while adding google+ comments to my web site 无法在 perticulat blogspot 执行 javascript,但它在其他 blogspot 中工作 - Unable to execute javascript at a perticulat blogspot, but it work in other blogspot Google+ API只读-插入时间是什么? - Google+ API read only - what is inserting a moment? 使Chrome扩展程序不适用于某些页面 - Making a Chrome extension not work on certain pages
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM