Tuesday, February 18, 2014

1st Oracle Technology Event @FIX University CampusnewsRus.com ...
720 × 479 - 40k - jpg

newsRus.com Agenda Cultural @FIX University Campus InglesAgil RecStay "56th ...
627 × 323 - 58k - jpg

Webby Awards 2013 / Agenda Cultural @ FIX UniversityCampus newsRus.com
448 × 294 - 24k - jpg

More FIX on the NET @ FIX University Cultural Campus
1600 × 1359 - 280k - jpg

Recently we released an update to Blogger’s commenting system that enables people to directly respond to comments. This capability is known as Threaded Comments. We are pleased to see quite a few people diving in and writing tutorials, including a screencast. It’s wonderful to see the enthusiasm of our developers!
In this post we will look at what are the changes required to modify a custom template to enable Threaded Comments, once you have fulfilled the requirements outlined in the Threaded Comments announcement post on Buzz.blogger.com. We will then look at how to customise the look and feel of the Threaded Comments using just CSS, and also have a quick peek at alternatives.
Please note, these instructions may not work if your blog’s template is heavily customised. Your template may possibly missing some of the b:includables that the instructions below depend on. Please try the following instructions on your template, but if they don’t work come to our Blogger Developer forum and get some help with patching your template.
The first step is to Edit the HTML for your Template, which can be found inside Settings under the Template tab. You must make sure to expand the Widget Templates, as we need to modify the main Blog Widget Template. To find the main Blog Widget code, search for the following Blogger Layouts Template code:
Inside the b:widget are a series of b:includable blocks. These act a lot like functions in programming languages, in that they can be called from other b:includable blocks to insert chunks of HTML. The only special block is the includable called main, which is where the Layout Template engine starts when rendering the Widget’s content. If you don’t see content inside the b:widget, you need to click the Expand Widget Templates radio button above the edit area.
The Layout Template should include the following code:


The interesting part is that we have a fork here, implemented as a b:if conditional block, that decides whether to render the comments as threaded or not. The need for this split can be seen on the Threaded Comments announcement on Buzz.blogger.com.
As a quick aside, if you don’t have this code, but instead just have something like the following:
Then you can get threaded comments by replacing this b:include with the above logic block, assuming you fulfill the requirements laid out in the Threaded Comments announcement post on Buzz.blogger.com.
Now you can look at the implementation of the threaded_comments includable by searching for the following line of code:
This code is responsible for rendering the actual threaded comments to screen. You can choose to override this code block to customise the look of your comments, but it is worth noting that if you do, you won’t get updates to this functionality as we change the implementation in the future.
There are two new data members we have introduced with this feature release that you can use to render comment threads:
  • data:post.commentSrc This is the source to the javascript library that handles actions
  • data:post.commentHtml This is the rendered HTML for the comment thread
If you want to change the look and feel of your comments, we strongly recommend you use the Template Designer to set custom CSS to style the Threaded Comments. We suggest you customise the comments by modifying the property "Advanced > Add CSS". For example, you can add the following CSS code to change the look:
.comments blockquote { 
    border: 1px solid black; color: white; font: Helvetica;
} // draws a border around comment bodies, sets the text font and colour
.comments .inline-thread li { list-style-type: decimal; } // numbers replies
Finally, you can implement your own version of Threaded Comments by walking the data:post.comments directly. This will contain all the comments, ordered by time of comment, now with an optional extra fielddata:comment.inReplyTo which will contain the id of the parent comment, if there is one.
If you have any questions about how to customise your Blogger Comments, please feel free to drop by the Blogger Developer Forum. We’re glad to help!


Blog Archive