Search code examples
javascriptcommentsgoogle-plusbloggerblogspot

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.

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.

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. The difference, though, is that in blog posts it has included the comments iframe, while the div element in the blog pages is empty. 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-viewtype translates into FILTERED_POSTMODin both cases as well.

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. 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.

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


Solution

  • 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.

    I guess this is Google's default behavior for the moment, then!