Tuesday, January 17, 2012

Tutorial mengubah Threaded Comment : Komentar Bertingkat pada Template Blogspot Kustom atau Lama

Blogspot memberikan fasilitas threaded comments atau komentar bertingkat di mana blogger dapat membalas komentar pembaca yang lainnya. Threaded comment blogspot otomatis berjalan pada platform template blogspot yang baru dan tanpa di kustomisasi macam-macam. Dan sebenarnya pada themes atau template blogspot yang lama pun Bloggspot menambahkan kode CSS commenting API pada HTML template.

Ada banyak cara yang bisa dilakukan oleh blogger untuk menjadikan template blog lawasnya untuk dapat menggunakan komentar bertingkat ini. Ada banyak sumber yang bisa di baca dan para blogger setelah sukses menerapkan komentar bertingkat di Blog-nya pun pasti posting untuk saling berbagi.

Adapun beberapa cara yang bisa digunakan adalah, saya melakukan eksperimen sendiri dan melalui googling akhirnya mendapatkan cara paling simpel, urutan yang saya lakukan adalah:

Blogspot Dashboard Settings
  1. Buka Dashboard >> Setting >> Template kemudian Backup atau cadangkan template, untuk diunduh dan disimpan jika oprek tak berhasil.
  2. Ganti template baru, pasti bisa secara otomatis, namun tentu akan memerlukan waktu lagi untuk mempercantik blog kita bukan?.
  3. Revert ke template bawaan, hal ini juga sangat mudah.
  4. Membuat blog baru, untuk testing melihat kode CSS pada template yang terbaru bawaan Blogspot. Download dan lihat kodenya, bandingkan, dan tertuju pada kode, Edit HTML >> Expand Template Widget kemudian cari:
    <b:widget id='Blog1' locked='false' title='Posting Blog' type='Blog'>
    
    Copy hingga ke:
    </b:widget>
    
    Jadinya seperti ini:
    <b:widget id='Blog1' locked='false' title='Posting Blog' type='Blog'>
    <b:includable id='nextprev'>
      <div class='blog-pager' id='blog-pager'>
        <b:if cond='data:newerPageUrl'>
          <span id='blog-pager-newer-link'>
          <a class='blog-pager-newer-link' expr:href='data:newerPageUrl' expr:id='data:widget.instanceId + &quot;_blog-pager-newer-link&quot;' expr:title='data:newerPageTitle'><data:newerPageTitle/></a>
          </span>
        </b:if>
    
        <b:if cond='data:olderPageUrl'>
          <span id='blog-pager-older-link'>
          <a class='blog-pager-older-link' expr:href='data:olderPageUrl' expr:id='data:widget.instanceId + &quot;_blog-pager-older-link&quot;' expr:title='data:olderPageTitle'><data:olderPageTitle/></a>
          </span>
        </b:if>
    
        <a class='home-link' expr:href='data:blog.homepageUrl'><data:homeMsg/></a>
    
        <b:if cond='data:mobileLinkUrl'>
          <div class='blog-mobile-link'>
            <a expr:href='data:mobileLinkUrl'><data:mobileLinkMsg/></a>
          </div>
        </b:if>
    
      </div>
      <div class='clear'/>
    </b:includable>
    <b:includable id='shareButtons' var='post'>
      <b:if cond='data:top.showEmailButton'><a class='goog-inline-block share-button sb-email' expr:href='data:post.sharePostUrl + &quot;&amp;target=email&quot;' expr:title='data:top.emailThisMsg' target='_blank'><span class='share-button-link-text'><data:top.emailThisMsg/></span></a></b:if><b:if cond='data:top.showBlogThisButton'><a class='goog-inline-block share-button sb-blog' expr:href='data:post.sharePostUrl + &quot;&amp;target=blog&quot;' expr:onclick='&quot;window.open(this.href, \&quot;_blank\&quot;, \&quot;height=270,width=475\&quot;); return false;&quot;' expr:title='data:top.blogThisMsg' target='_blank'><span class='share-button-link-text'><data:top.blogThisMsg/></span></a></b:if><b:if cond='data:top.showTwitterButton'><a class='goog-inline-block share-button sb-twitter' expr:href='data:post.sharePostUrl + &quot;&amp;target=twitter&quot;' expr:title='data:top.shareToTwitterMsg' target='_blank'><span class='share-button-link-text'><data:top.shareToTwitterMsg/></span></a></b:if><b:if cond='data:top.showFacebookButton'><a class='goog-inline-block share-button sb-facebook' expr:href='data:post.sharePostUrl + &quot;&amp;target=facebook&quot;' expr:onclick='&quot;window.open(this.href, \&quot;_blank\&quot;, \&quot;height=430,width=640\&quot;); return false;&quot;' expr:title='data:top.shareToFacebookMsg' target='_blank'><span class='share-button-link-text'><data:top.shareToFacebookMsg/></span></a></b:if><b:if cond='data:top.showOrkutButton'><a class='goog-inline-block share-button sb-orkut' expr:href='data:post.sharePostUrl + &quot;&amp;target=orkut&quot;' expr:title='data:top.shareToOrkutMsg' target='_blank'><span class='share-button-link-text'><data:top.shareToOrkutMsg/></span></a></b:if><b:if cond='data:top.showDummy'><div class='goog-inline-block dummy-container'><data:post.dummyTag/></div></b:if>
    </b:includable>
    <b:includable id='threaded_comment_js' var='post'>
      <script defer='defer' expr:src='data:post.commentSrc' type='text/javascript'/>
    
      <script type='text/javascript'>
        (function() {
          var items = <data:post.commentJso/>;
          var msgs = <data:post.commentMsgs/>;
          var postId = &#39;<data:post.id/>&#39;;
          var feed = &#39;<data:post.commentFeed/>&#39;;
          var authorName = &#39;<data:post.author/>&#39;;
          var authorUrl = &#39;<data:post.authorUrl/>&#39;;
          var blogId = &#39;<data:top.id/>&#39;;
          var baseUri = &#39;<data:post.commentBase/>&#39;;
    
    // <![CDATA[
          feed += '?alt=json&v=2&orderby=published&reverse=false&max-results=50';
          var cursor = null;
          if (items && items.length > 0) {
            cursor = parseInt(items[items.length - 1].timestamp) + 1;
          }
    
          var bodyFromEntry = function(entry) {
            if (entry.gd$extendedProperty) {
              for (var k in entry.gd$extendedProperty) {
                if (entry.gd$extendedProperty[k].name == 'blogger.contentRemoved') {
                  return '<span class="deleted-comment">' + entry.content.$t + '</span>';
                }
              }
            }
            return entry.content.$t;
          }
    
          var parse = function(data) {
            cursor = null;
            var comments = [];
            if (data && data.feed && data.feed.entry) {
              for (var i = 0, entry; entry = data.feed.entry[i]; i++) {
                var comment = {};
                // comment ID, parsed out of the original id format
                var id = /blog-(\d+).post-(\d+)/.exec(entry.id.$t);
                comment.id = id ? id[2] : null;
                comment.body = bodyFromEntry(entry);
                comment.timestamp = Date.parse(entry.published.$t) + '';
                if (entry.author && entry.author.constructor === Array) {
                  var auth = entry.author[0];
                  if (auth) {
                    comment.author = {
                      name: (auth.name ? auth.name.$t : undefined),
                      profileUrl: (auth.uri ? auth.uri.$t : undefined),
                      avatarUrl: (auth.gd$image ? auth.gd$image.src : undefined)
                    };
                  }
                }
                if (entry.link) {
                  if (entry.link[2]) {
                    comment.link = comment.permalink = entry.link[2].href;
                  }
                  if (entry.link[3]) {
                    var pid = /.*comments\/default\/(\d+)\?.*/.exec(entry.link[3].href);
                    if (pid && pid[1]) {
                      comment.parentId = pid[1];
                    }
                  }
                }
                comment.deleteclass = 'item-control blog-admin';
                if (entry.gd$extendedProperty) {
                  for (var k in entry.gd$extendedProperty) {
                    console.log(entry.gd$extendedProperty[k].name + ' - ' + entry.gd$extendedProperty[k].value);
                    if (entry.gd$extendedProperty[k].name == 'blogger.itemClass') {
                      comment.deleteclass += ' ' + entry.gd$extendedProperty[k].value;
                    }
                  }
                }
                comments.push(comment);
              }
            }
            return comments;
          };
    
          var paginator = function(callback) {
            if (hasMore()) {
              var url = feed;
              if (cursor) {
                url += '&published-min=' + new Date(cursor).toISOString();
              }
              window.bloggercomments = function(data) {
                var parsed = parse(data);
                cursor = parsed.length < 50 ? null
                    : parseInt(parsed[parsed.length - 1].timestamp) + 1
                callback(parsed);
                window.bloggercomments = null;
              }
              url += '&callback=bloggercomments';
              var script = document.createElement('script');
              script.type = 'text/javascript';
              script.src = url;
              document.getElementsByTagName('head')[0].appendChild(script);
            }
          };
          var hasMore = function() {
            return !!cursor;
          };
          var getMeta = function(key, comment) {
            if ('iswriter' == key) {
              var matches = !!comment.author
                  && comment.author.name == authorName
                  && comment.author.profileUrl == authorUrl;
              return matches ? 'true' : '';
            } else if ('deletelink' == key) {
              return baseUri + '/delete-comment.g?blogID=' + blogId + '&postID=' + comment.id;
            } else if ('deleteclass' == key) {
              return comment.deleteclass;
            }
            return '';
          };
    
          var replybox = null;
          var replyUrlParts = null;
          var replyParent = undefined;
    
          var onReply = function(commentId, domId) {
            if (replybox == null) {
              // lazily cache replybox, and adjust to suit this style:
              replybox = document.getElementById('comment-editor');
              if (replybox != null) {
                replybox.height = '250px';
                replybox.style.display = 'block';
                replyUrlParts = replybox.src.split('#');
              }
            }
            if (replybox && (commentId !== replyParent)) {
              document.getElementById(domId).insertBefore(replybox, null);
              replybox.src = replyUrlParts[0]
                  + (commentId ? '&parentID=' + commentId : '')
                  + '#' + replyUrlParts[1];
              replyParent = commentId;
            }
          };
    
          var tok = 'comment-form_';
          var hash = window.location.hash || '';
          var startThread = hash.indexOf(tok) == 1 ? hash.substring(tok.length + 1) : undefined;
    
          // Configure commenting API:
          var configJso = {
            'maxDepth': 2
          };
          var provider = {
            'id': postId,
            'data': items,
            'loadNext': paginator,
            'hasMore': hasMore,
            'getMeta': getMeta,
            'onReply': onReply,
            'rendered': true,
            'initReplyThread': startThread,
            'config': configJso,
            'messages': msgs
          };
    
          var render = function() {
            if (window.goog && window.goog.comments) {
              var holder = document.getElementById('comment-holder');
              window.goog.comments.render(holder, provider);
            }
          };
    
          // render now, or queue to render when library loads:
          if (window.goog && window.goog.comments) {
            render();
          } else {
            window.goog = window.goog || {};
            window.goog.comments = window.goog.comments || {};
            window.goog.comments.loadQueue = window.goog.comments.loadQueue || [];
            window.goog.comments.loadQueue.push(render);
          }
        })();
    // ]]>
      </script>
    </b:includable>
    <b:includable id='backlinks' var='post'>
      <a name='links'/><h4><data:post.backlinksLabel/></h4>
      <b:if cond='data:post.numBacklinks != 0'>
        <dl class='comments-block' id='comments-block'>
          <b:loop values='data:post.backlinks' var='backlink'>
            <div class='collapsed-backlink backlink-control'>
              <dt class='comment-title'>
                <span class='backlink-toggle-zippy'>&#160;</span>
                <a expr:href='data:backlink.url' rel='nofollow'><data:backlink.title/></a>
                <b:include data='backlink' name='backlinkDeleteIcon'/>
              </dt>
              <dd class='comment-body collapseable'>
                <data:backlink.snippet/>
              </dd>
              <dd class='comment-footer collapseable'>
                <span class='comment-author'><data:post.authorLabel/> <data:backlink.author/></span>
                <span class='comment-timestamp'><data:post.timestampLabel/> <data:backlink.timestamp/></span>
              </dd>
            </div>
          </b:loop>
        </dl>
      </b:if>
      <p class='comment-footer'>
        <a class='comment-link' expr:href='data:post.createLinkUrl' expr:id='data:widget.instanceId + &quot;_backlinks-create-link&quot;' target='_blank'><data:post.createLinkLabel/></a>
      </p>
    </b:includable>
    <b:includable id='mobile-main' var='top'>
        <!-- posts -->
        <div class='blog-posts hfeed'>
    
          <b:include data='top' name='status-message'/>
    
          <b:if cond='data:blog.pageType == &quot;index&quot;'>
            <b:loop values='data:posts' var='post'>
              <b:include data='post' name='mobile-index-post'/>
            </b:loop>
          <b:else/>
            <b:loop values='data:posts' var='post'>
              <b:include data='post' name='mobile-post'/>
            </b:loop>
          </b:if>
        </div>
    
       <b:include name='mobile-nextprev'/>
    </b:includable>
    <b:includable id='post' var='post'>
      <div class='post hentry'>
        <a expr:name='data:post.id'/>
        <b:if cond='data:post.title'>
          <h3 class='post-title entry-title'>
          <b:if cond='data:post.link'>
            <a expr:href='data:post.link'><data:post.title/></a>
          <b:else/>
            <b:if cond='data:post.url'>
              <b:if cond='data:blog.url != data:post.url'>
                <a expr:href='data:post.url'><data:post.title/></a>
              <b:else/>
                <data:post.title/>
              </b:if>
            <b:else/>
              <data:post.title/>
            </b:if>
          </b:if>
          </h3>
        </b:if>
    
        <div class='post-header'>
        <div class='post-header-line-1'/>
        </div>
    
        <div class='post-body entry-content' expr:id='&quot;post-body-&quot; + data:post.id'>
          <data:post.body/>
          <div style='clear: both;'/> <!-- clear for photos floats -->
        </div>
    
        <b:if cond='data:post.hasJumpLink'>
          <div class='jump-link'>
            <a expr:href='data:post.url + &quot;#more&quot;' expr:title='data:post.title'><data:post.jumpText/></a>
          </div>
        </b:if>
    
        <div class='post-footer'>
    
        <div class='post-footer-line post-footer-line-1'><span class='post-author vcard'>
            <b:if cond='data:top.showAuthor'>
              <data:top.authorLabel/>
                <b:if cond='data:post.authorProfileUrl'>
                  <span class='fn'>
                    <a expr:href='data:post.authorProfileUrl' rel='author' title='author profile'>
                      <data:post.author/>
                    </a>
                  </span>
                <b:else/>
                  <span class='fn'><data:post.author/></span>
                </b:if>
            </b:if>
          </span> <span class='post-timestamp'>
            <b:if cond='data:top.showTimestamp'>
              <data:top.timestampLabel/>
            <b:if cond='data:post.url'>
              <a class='timestamp-link' expr:href='data:post.url' rel='bookmark' title='permanent link'><abbr class='published' expr:title='data:post.timestampISO8601'><data:post.timestamp/></abbr></a>
            </b:if>
            </b:if>
          </span> <span class='post-comment-link'>
            <b:if cond='data:blog.pageType != &quot;item&quot;'>
              <b:if cond='data:blog.pageType != &quot;static_page&quot;'>
                <b:if cond='data:post.allowComments'>
                  <a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><b:if cond='data:post.numComments == 1'>1 <data:top.commentLabel/><b:else/><data:post.numComments/> <data:top.commentLabelPlural/></b:if></a>
                </b:if>
              </b:if>
            </b:if>
          </span> <span class='post-icons'>
            <!-- email post links -->
            <b:if cond='data:post.emailPostUrl'>
              <span class='item-action'>
              <a expr:href='data:post.emailPostUrl' expr:title='data:top.emailPostMsg'>
                  <img alt='' class='icon-action' height='13' src='http://img1.blogblog.com/img/icon18_email.gif' width='18'/>
              </a>
              </span>
            </b:if>
    
            <!-- quickedit pencil -->
            <b:include data='post' name='postQuickEdit'/>
          </span> <div class='post-share-buttons goog-inline-block'>
            <b:if cond='data:post.sharePostUrl'>
              <b:include data='post' name='shareButtons'/>
            </b:if>
          </div> <span class='post-backlinks post-comment-link'>
             <b:if cond='data:blog.pageType != &quot;item&quot;'>
               <b:if cond='data:blog.pageType != &quot;static_page&quot;'>
                 <b:if cond='data:post.showBacklinks'>
                   <a class='comment-link' expr:href='data:post.url + &quot;#links&quot;'><data:top.backlinkLabel/></a>
                 </b:if>
               </b:if>
             </b:if>
           </span> </div>
    
          <div class='post-footer-line post-footer-line-2'><span class='post-labels'>
            <b:if cond='data:post.labels'>
              <data:postLabelsLabel/>
              <b:loop values='data:post.labels' var='label'>
                <a expr:href='data:label.url' rel='tag'><data:label.name/></a><b:if cond='data:label.isLast != &quot;true&quot;'>,</b:if>
              </b:loop>
            </b:if>
          </span> </div>
    
          <div class='post-footer-line post-footer-line-3'><span class='post-location'>
            <b:if cond='data:top.showLocation'>
              <b:if cond='data:post.location'>
                <data:postLocationLabel/>
                <a expr:href='data:post.location.mapsUrl' target='_blank'><data:post.location.name/></a>
              </b:if>
            </b:if>
          </span> </div>
        </div>
      </div>
    </b:includable>
    <b:includable id='status-message'>
      <b:if cond='data:navMessage'>
      <div class='status-msg-wrap'>
        <div class='status-msg-body'>
          <data:navMessage/>
        </div>
        <div class='status-msg-border'>
          <div class='status-msg-bg'>
            <div class='status-msg-hidden'><data:navMessage/></div>
          </div>
        </div>
      </div>
      <div style='clear: both;'/>
      </b:if>
    </b:includable>
    <b:includable id='comment-form' var='post'>
      <div class='comment-form'>
        <a name='comment-form'/>
        <b:if cond='data:mobile'>
          <h4 id='comment-post-message'>
            <a expr:id='data:widget.instanceId + &quot;_comment-editor-toggle-link&quot;' href='javascript:void(0)'><data:postCommentMsg/></a></h4>
          <p><data:blogCommentMessage/></p>
          <data:blogTeamBlogMessage/>
          <a expr:href='data:post.commentFormIframeSrc' id='comment-editor-src'/>
          <iframe allowtransparency='true' class='blogger-iframe-colorize blogger-comment-from-post' frameborder='0' height='410' id='comment-editor' name='comment-editor' src='' style='display: none' width='100%'/>
        <b:else/>
          <h4 id='comment-post-message'><data:postCommentMsg/></h4>
          <p><data:blogCommentMessage/></p>
          <data:blogTeamBlogMessage/>
          <a expr:href='data:post.commentFormIframeSrc' id='comment-editor-src'/>
          <iframe allowtransparency='true' class='blogger-iframe-colorize blogger-comment-from-post' frameborder='0' height='410' id='comment-editor' name='comment-editor' src='' width='100%'/>
        </b:if>
        <data:post.friendConnectJs/>
        <data:post.cmtfpIframe/>
        <script type='text/javascript'>
          BLOG_CMT_createIframe(&#39;<data:post.appRpcRelayPath/>&#39;, &#39;<data:post.communityId/>&#39;);
        </script>
      </div>
    </b:includable>
    <b:includable id='threaded_comments' var='post'>
      <b:include name='threaded_comment_css'/>
    
      <div class='comments' id='comments'>
        <a name='comments'/>
        <h4>
          <b:if cond='data:post.numComments == 1'>
            1 <data:commentLabel/>:
          <b:else/>
            <data:post.numComments/> <data:commentLabelPlural/>:
          </b:if>
        </h4>
    
        <div class='comments-content'>
          <b:if cond='data:post.embedCommentForm'>
            <b:include data='post' name='threaded_comment_js'/>
          </b:if>
          <div id='comment-holder'>
             <data:post.commentHtml/>
          </div>
        </div>
    
        <p class='comment-footer'>
          <b:if cond='data:post.allowNewComments'>
            <b:include data='post' name='threaded-comment-form'/>
          <b:else/>
            <data:post.noNewCommentsText/>
          </b:if>
        </p>
    
        <b:if cond='data:showCmtPopup'>
          <div id='comment-popup'>
            <iframe allowtransparency='true' frameborder='0' id='comment-actions' name='comment-actions' scrolling='no'>
            </iframe>
          </div>
        </b:if>
    
        <div id='backlinks-container'>
        <div expr:id='data:widget.instanceId + &quot;_backlinks-container&quot;'>
           <b:if cond='data:post.showBacklinks'>
             <b:include data='post' name='backlinks'/>
           </b:if>
        </div>
        </div>
      </div>
    </b:includable>
    <b:includable id='backlinkDeleteIcon' var='backlink'>
      <span expr:class='&quot;item-control &quot; + data:backlink.adminClass'>
        <a expr:href='data:backlink.deleteUrl' expr:title='data:top.deleteBacklinkMsg'>
          <img src='//www.blogger.com/img/icon_delete13.gif'/>
        </a>
      </span>
    </b:includable>
    <b:includable id='mobile-nextprev'>
      <div class='blog-pager' id='blog-pager'>
        <b:if cond='data:newerPageUrl'>
          <div class='mobile-link-button' id='blog-pager-newer-link'>
          <a class='blog-pager-newer-link' expr:href='data:newerPageUrl' expr:id='data:widget.instanceId + &quot;_blog-pager-newer-link&quot;' expr:title='data:newerPageTitle'>&amp;lsaquo;</a>
          </div>
        </b:if>
    
        <b:if cond='data:olderPageUrl'>
          <div class='mobile-link-button' id='blog-pager-older-link'>
          <a class='blog-pager-older-link' expr:href='data:olderPageUrl' expr:id='data:widget.instanceId + &quot;_blog-pager-older-link&quot;' expr:title='data:olderPageTitle'>&amp;rsaquo;</a>
          </div>
        </b:if>
    
        <div class='mobile-link-button' id='blog-pager-home-link'>
        <a class='home-link' expr:href='data:blog.homepageUrl'><data:homeMsg/></a>
        </div>
    
        <div class='mobile-desktop-link'>
          <a class='home-link' expr:href='data:desktopLinkUrl'><data:desktopLinkMsg/></a>
        </div>
    
      </div>
      <div class='clear'/>
    </b:includable>
    <b:includable id='mobile-post' var='post'>
      <div class='date-outer'>
        <b:if cond='data:post.dateHeader'>
          <h2 class='date-header'><span><data:post.dateHeader/></span></h2>
        </b:if>
        <div class='date-posts'>
          <div class='post-outer'>
    
            <div class='post hentry uncustomized-post-template'>
              <a expr:name='data:post.id'/>
              <b:if cond='data:post.title'>
                <h3 class='post-title entry-title'>
                  <b:if cond='data:post.link'>
                    <a expr:href='data:post.link'><data:post.title/></a>
                  <b:else/>
                    <b:if cond='data:post.url'>
                      <b:if cond='data:blog.url != data:post.url'>
                        <a expr:href='data:post.url'><data:post.title/></a>
                      <b:else/>
                        <data:post.title/>
                      </b:if>
                    <b:else/>
                      <data:post.title/>
                    </b:if>
                  </b:if>
                </h3>
              </b:if>
    
              <div class='post-header'>
                <div class='post-header-line-1'/>
              </div>
    
              <div class='post-body entry-content' expr:id='&quot;post-body-&quot; + data:post.id'>
                <data:post.body/>
                <div style='clear: both;'/> <!-- clear for photos floats -->
              </div>
    
              <div class='post-footer'>
                <div class='post-footer-line post-footer-line-1'>
                  <span class='post-author vcard'>
                    <b:if cond='data:top.showAuthor'>
                      <b:if cond='data:post.authorProfileUrl'>
                        <span class='fn'>
                          <a expr:href='data:post.authorProfileUrl' rel='author' title='author profile'>
                            <data:post.author/>
                          </a>
                        </span>
                      <b:else/>
                        <span class='fn'><data:post.author/></span>
                      </b:if>
                    </b:if>
                  </span>
    
                  <span class='post-timestamp'>
                    <b:if cond='data:top.showTimestamp'>
                      <data:top.timestampLabel/>
                      <b:if cond='data:post.url'>
                        <a class='timestamp-link' expr:href='data:post.url' rel='bookmark' title='permanent link'><abbr class='published' expr:title='data:post.timestampISO8601'><data:post.timestamp/></abbr></a>
                      </b:if>
                    </b:if>
                  </span>
    
                  <span class='post-comment-link'>
                    <b:if cond='data:blog.pageType != &quot;item&quot;'>
                      <b:if cond='data:blog.pageType != &quot;static_page&quot;'>
                        <b:if cond='data:post.allowComments'>
                          <a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><b:if cond='data:post.numComments == 1'>1 <data:top.commentLabel/><b:else/><data:post.numComments/> <data:top.commentLabelPlural/></b:if></a>
                        </b:if>
                      </b:if>
                    </b:if>
                  </span>
                </div>
    
                <div class='post-footer-line post-footer-line-2'>
                  <b:if cond='data:top.showMobileShare'>
                    <div class='mobile-link-button goog-inline-block' id='mobile-share-button'>
                      <a href='javascript:void(0);'><data:shareMsg/></a>
                    </div>
                  </b:if>
                  <b:if cond='data:top.showDummy'>
                    <div class='goog-inline-block dummy-container'><data:post.dummyTag/></div>
                  </b:if>
                </div>
    
              </div>
            </div>
    
            <b:if cond='data:blog.pageType == &quot;static_page&quot;'>
              <b:if cond='data:post.showThreadedComments'>
                <b:include data='post' name='threaded_comments'/>
              <b:else/>
                <b:include data='post' name='comments'/>
              </b:if>
            </b:if>
            <b:if cond='data:blog.pageType == &quot;item&quot;'>
              <b:if cond='data:post.showThreadedComments'>
                <b:include data='post' name='threaded_comments'/>
              <b:else/>
                <b:include data='post' name='comments'/>
              </b:if>
            </b:if>
          </div>
        </div>
      </div>
    </b:includable>
    <b:includable id='postQuickEdit' var='post'>
      <b:if cond='data:post.editUrl'>
        <span expr:class='&quot;item-control &quot; + data:post.adminClass'>
          <a expr:href='data:post.editUrl' expr:title='data:top.editPostMsg'>
            <img alt='' class='icon-action' height='18' src='http://img2.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/>
          </a>
        </span>
      </b:if>
    </b:includable>
    <b:includable id='main' var='top'>
      <b:if cond='data:mobile == &quot;false&quot;'>
    
        <!-- posts -->
        <div class='blog-posts hfeed'>
    
          <b:include data='top' name='status-message'/>
    
          <data:defaultAdStart/>
          <b:loop values='data:posts' var='post'>
            <b:if cond='data:post.isDateStart'>
              <b:if cond='data:post.isFirstPost == &quot;false&quot;'>
                &lt;/div&gt;&lt;/div&gt;
              </b:if>
            </b:if>
            <b:if cond='data:post.isDateStart'>
              &lt;div class=&quot;date-outer&quot;&gt;
            </b:if>
            <b:if cond='data:post.dateHeader'>
              <h2 class='date-header'><span><data:post.dateHeader/></span></h2>
            </b:if>
            <b:if cond='data:post.isDateStart'>
              &lt;div class=&quot;date-posts&quot;&gt;
            </b:if>
            <div class='post-outer'>
            <b:include data='post' name='post'/>
            <b:if cond='data:blog.pageType == &quot;static_page&quot;'>
              <b:if cond='data:post.showThreadedComments'>
                <b:include data='post' name='threaded_comments'/>
              <b:else/>
                <b:include data='post' name='comments'/>
              </b:if>
            </b:if>
            <b:if cond='data:blog.pageType == &quot;item&quot;'>
              <b:if cond='data:post.showThreadedComments'>
                <b:include data='post' name='threaded_comments'/>
              <b:else/>
                <b:include data='post' name='comments'/>
              </b:if>
            </b:if>
            </div>
            <b:if cond='data:post.includeAd'>
              <b:if cond='data:post.isFirstPost'>
                <data:defaultAdEnd/>
              <b:else/>
                <data:adEnd/>
              </b:if>
              <div class='inline-ad'>
                <data:adCode/>
              </div>
              <data:adStart/>
            </b:if>
          </b:loop>
          <b:if cond='data:numPosts != 0'>
            &lt;/div&gt;&lt;/div&gt;
          </b:if>
          <data:adEnd/>
        </div>
    
        <!-- navigation -->
        <b:include name='nextprev'/>
    
        <!-- feed links -->
        <b:include name='feedLinks'/>
    
        <b:if cond='data:top.showStars'>
          <script src='//www.google.com/jsapi' type='text/javascript'/>
          <script type='text/javascript'>
            google.load(&quot;annotations&quot;, &quot;1&quot;, {&quot;locale&quot;: &quot;<data:top.languageCode/>&quot;});
            function initialize() {
              google.annotations.setApplicationId(<data:top.blogspotReviews/>);
              google.annotations.createAll();
              google.annotations.fetch();
            }
            google.setOnLoadCallback(initialize);
          </script>
        </b:if>
    
      <b:else/>
        <b:include name='mobile-main'/>
      </b:if>
    
      <b:if cond='data:top.showDummy'>
        <data:top.dummyBootstrap/>
      </b:if>
    
    </b:includable>
    <b:includable id='commentDeleteIcon' var='comment'>
      <span expr:class='&quot;item-control &quot; + data:comment.adminClass'>
        <b:if cond='data:showCmtPopup'>
          <div class='goog-toggle-button'>
            <div class='goog-inline-block comment-action-icon'/>
          </div>
        <b:else/>
          <a class='comment-delete' expr:href='data:comment.deleteUrl' expr:title='data:top.deleteCommentMsg'>
            <img src='//www.blogger.com/img/icon_delete13.gif'/>
          </a>
        </b:if>
      </span>
    </b:includable>
    <b:includable id='feedLinks'>
      <b:if cond='data:blog.pageType != &quot;item&quot;'> <!-- Blog feed links -->
        <b:if cond='data:feedLinks'>
          <div class='blog-feeds'>
            <b:include data='feedLinks' name='feedLinksBody'/>
          </div>
        </b:if>
    
        <b:else/> <!--Post feed links -->
        <div class='post-feeds'>
          <b:loop values='data:posts' var='post'>
            <b:if cond='data:post.allowComments'>
              <b:if cond='data:post.feedLinks'>
                <b:include data='post.feedLinks' name='feedLinksBody'/>
              </b:if>
            </b:if>
          </b:loop>
        </div>
      </b:if>
    </b:includable>
    <b:includable id='threaded-comment-form' var='post'>
      <div class='comment-form'>
        <a name='comment-form'/>
        <b:if cond='data:mobile'>
          <p><data:blogCommentMessage/></p>
          <data:blogTeamBlogMessage/>
          <a expr:href='data:post.commentFormIframeSrc' id='comment-editor-src'/>
          <iframe allowtransparency='true' class='blogger-iframe-colorize blogger-comment-from-post' frameborder='0' height='410' id='comment-editor' name='comment-editor' src='' style='display: none' width='100%'/>
        <b:else/>
          <p><data:blogCommentMessage/></p>
          <data:blogTeamBlogMessage/>
          <a expr:href='data:post.commentFormIframeSrc' id='comment-editor-src'/>
          <iframe allowtransparency='true' class='blogger-iframe-colorize blogger-comment-from-post' frameborder='0' height='410' id='comment-editor' name='comment-editor' src='' width='100%'/>
        </b:if>
        <data:post.friendConnectJs/>
        <data:post.cmtfpIframe/>
        <script type='text/javascript'>
          BLOG_CMT_createIframe(&#39;<data:post.appRpcRelayPath/>&#39;, &#39;<data:post.communityId/>&#39;);
        </script>
      </div>
    </b:includable>
    <b:includable id='threaded_comment_css'>
      <style>
    .comments {
      clear: both;
      margin-top: 10px;
      margin-bottom: 0px;
      line-height: 1em;
    }
    .comments .comments-content {
      font-size: 13px;
      margin-bottom: 16px;
    }
    .comments .comment .comment-actions a {
      padding-top: 5px;
      padding-right: 5px;
    }
    .comments .comment .comment-actions a:hover {
      text-decoration: underline;
    }
    .comments .comments-content .comment-thread ol {
      list-style-type: none;
      padding: 0;
      text-align: left;
    }
    .comments .comments-content .inline-thread {
      padding: 0.5em 1em;
    }
    .comments .comments-content .comment-thread {
      margin: 8px 0px;
    }
    .comments .comments-content .comment-thread:empty {
      display: none;
    }
    .comments .comments-content .comment-replies {
      margin-top: 1em;
      margin-left: 36px;
    }
    .comments .comments-content .comment {
      margin-bottom:16px;
      padding-bottom:8px;
    }
    .comments .comments-content .comment:first-child {
      padding-top:16px;
    }
    .comments .comments-content .comment:last-child {
      border-bottom:0;
      padding-bottom:0;
    }
    .comments .comments-content .comment-body {
      position:relative;
    }
    .comments .comments-content .user {
      font-style:normal;
      font-weight:bold;
    }
    .comments .comments-content .icon.blog-author {
      width: 18px;
      height: 18px;
      display: inline-block;
      margin: 0 0 -4px 6px;
    }
    .comments .comments-content .datetime {
      margin-left:6px;
    }
    .comments .comments-content .comment-header,
    .comments .comments-content .comment-content {
      margin:0 0 8px;
    }
    .comments .comments-content .comment-content {
      text-align:justify;
    }
    .comments .comments-content .owner-actions {
      position:absolute;
      right:0;
      top:0;
    }
    .comments .comments-replybox {
      border: none;
      height: 250px;
      width: 100%;
    }
    .comments .comment-replybox-single {
      margin-top: 5px;
      margin-left: 48px;
    }
    .comments .comment-replybox-thread {
      margin-top: 5px;
    }
    .comments .comments-content .loadmore a {
      display: block;
      padding: 10px 16px;
      text-align: center;
    }
    .comments .thread-toggle {
      cursor: pointer;
      display: inline-block;
    }
    .comments .continue {
      cursor: pointer;
    }
    .comments .continue a {
      display: block;
      padding: 0.5em;
      font-weight: bold;
    }
    .comments .comments-content .loadmore {
      cursor: pointer;
      max-height: 3em;
      margin-top: 3em;
    }
    .comments .comments-content .loadmore.loaded {
      max-height: 0px;
      opacity: 0;
      overflow: hidden;
    }
    .comments .thread-chrome.thread-collapsed {
      display: none;
    }
    .comments .thread-toggle {
      display: inline-block;
    }
    .comments .thread-toggle .thread-arrow {
      display: inline-block;
      height: 6px;
      width: 7px;
      overflow: visible;
      margin: 0.3em;
      padding-right: 4px;
    }
    .comments .thread-expanded .thread-arrow {
      background: url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAG0lEQVR42mNgwAfKy8v/48I4FeA0AacVDFQBAP9wJkE/KhUMAAAAAElFTkSuQmCC&quot;) no-repeat scroll 0 0 transparent;
    }
    .comments .thread-collapsed .thread-arrow {
      background: url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAJUlEQVR42mNgAILy8vL/DLgASBKnApgkVgXIkhgKiNKJ005s4gDLbCZBiSxfygAAAABJRU5ErkJggg==&quot;) no-repeat scroll 0 0 transparent;
    }
    .comments .avatar-image-container {
      float: left;
      width: 36px;
      max-height: 36px;
      overflow: hidden;
    }
    .comments .avatar-image-container img {
      width: 36px;
    }
    .comments .comment-block {
      margin-left: 48px;
      position: relative;
    }
    
    /* Responsive styles. */
    @media screen and (max-device-width: 480px) {
      .comments .comments-content .comment-replies {
        margin-left: 0;
      }
    }
      </style>
    </b:includable>
    <b:includable id='mobile-index-post' var='post'>
      <div class='mobile-date-outer date-outer'>
        <b:if cond='data:post.dateHeader'>
          <div class='date-header'>
            <span><data:post.dateHeader/></span>
          </div>
        </b:if>
    
        <div class='mobile-post-outer'>
          <a expr:href='data:post.url'>
            <h3 class='mobile-index-title entry-title'>
              <data:post.title/>
            </h3>
    
            <div class='mobile-index-arrow'>&amp;rsaquo;</div>
    
            <div class='mobile-index-contents'>
              <b:if cond='data:post.thumbnailUrl'>
                <div class='mobile-index-thumbnail'>
                  <div class='Image'>
                    <img expr:src='data:post.thumbnailUrl'/>
                  </div>
                </div>
              </b:if>
    
              <div class='post-body'>
                <b:if cond='data:post.snippet'><data:post.snippet/></b:if>
              </div>
            </div>
    
            <div style='clear: both;'/>
          </a>
    
          <div class='mobile-index-comment'>
            <b:if cond='data:blog.pageType != &quot;static_page&quot;'>
              <b:if cond='data:post.allowComments'>
                <b:if cond='data:post.numComments != 0'>
                  <a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><b:if cond='data:post.numComments == 1'>1 <data:top.commentLabel/><b:else/><data:post.numComments/> <data:top.commentLabelPlural/></b:if></a>
                </b:if>
              </b:if>
            </b:if>
          </div>
        </div>
      </div>
    </b:includable>
    <b:includable id='feedLinksBody' var='links'>
      <div class='feed-links'>
      <data:feedLinksMsg/>
      <b:loop values='data:links' var='f'>
         <a class='feed-link' expr:href='data:f.url' expr:type='data:f.mimeType' target='_blank'><data:f.name/> (<data:f.feedType/>)</a>
      </b:loop>
      </div>
    </b:includable>
    <b:includable id='comments' var='post'>
      <div class='comments' id='comments'>
        <a name='comments'/>
        <b:if cond='data:post.allowComments'>
          <h4>
            <b:if cond='data:post.numComments == 1'>
              1 <data:commentLabel/>:
            <b:else/>
              <data:post.numComments/> <data:commentLabelPlural/>:
            </b:if>
          </h4>
    
          <b:if cond='data:post.commentPagingRequired'>
            <span class='paging-control-container'>
              <a expr:class='data:post.oldLinkClass' expr:href='data:post.oldestLinkUrl'><data:post.oldestLinkText/></a>
              &#160;
              <a expr:class='data:post.oldLinkClass' expr:href='data:post.olderLinkUrl'><data:post.olderLinkText/></a>
              &#160;
              <data:post.commentRangeText/>
              &#160;
              <a expr:class='data:post.newLinkClass' expr:href='data:post.newerLinkUrl'><data:post.newerLinkText/></a>
              &#160;
              <a expr:class='data:post.newLinkClass' expr:href='data:post.newestLinkUrl'><data:post.newestLinkText/></a>
            </span>
          </b:if>
    
          <div expr:id='data:widget.instanceId + &quot;_comments-block-wrapper&quot;'>
            <dl expr:class='data:post.avatarIndentClass' id='comments-block'>
              <b:loop values='data:post.comments' var='comment'>
                <dt expr:class='&quot;comment-author &quot; + data:comment.authorClass' expr:id='data:comment.anchorName'>
                  <b:if cond='data:comment.favicon'>
                    <img expr:src='data:comment.favicon' height='16px' style='margin-bottom:-2px;' width='16px'/>
                  </b:if>
                  <a expr:name='data:comment.anchorName'/>
                  <b:if cond='data:blog.enabledCommentProfileImages'>
                    <data:comment.authorAvatarImage/>
                  </b:if>
                  <b:if cond='data:comment.authorUrl'>
                    <a expr:href='data:comment.authorUrl' rel='nofollow'><data:comment.author/></a>
                  <b:else/>
                    <data:comment.author/>
                  </b:if>
                  <data:commentPostedByMsg/>
                </dt>
                <dd class='comment-body' expr:id='data:widget.instanceId + data:comment.cmtBodyIdPostfix'>
                  <b:if cond='data:comment.isDeleted'>
                    <span class='deleted-comment'><data:comment.body/></span>
                  <b:else/>
                    <p>
                      <data:comment.body/>
                    </p>
                  </b:if>
                </dd>
                <dd class='comment-footer'>
                  <span class='comment-timestamp'>
                    <a expr:href='data:comment.url' title='comment permalink'>
                      <data:comment.timestamp/>
                    </a>
                    <b:include data='comment' name='commentDeleteIcon'/>
                  </span>
                </dd>
              </b:loop>
            </dl>
          </div>
    
          <b:if cond='data:post.commentPagingRequired'>
            <span class='paging-control-container'>
              <a expr:class='data:post.oldLinkClass' expr:href='data:post.oldestLinkUrl'>
                <data:post.oldestLinkText/>
              </a>
              <a expr:class='data:post.oldLinkClass' expr:href='data:post.olderLinkUrl'>
                <data:post.olderLinkText/>
              </a>
              &#160;
              <data:post.commentRangeText/>
              &#160;
              <a expr:class='data:post.newLinkClass' expr:href='data:post.newerLinkUrl'>
                <data:post.newerLinkText/>
              </a>
              <a expr:class='data:post.newLinkClass' expr:href='data:post.newestLinkUrl'>
                <data:post.newestLinkText/>
              </a>
            </span>
          </b:if>
    
          <p class='comment-footer'>
            <b:if cond='data:post.embedCommentForm'>
              <b:if cond='data:post.allowNewComments'>
                <b:include data='post' name='comment-form'/>
              <b:else/>
                <data:post.noNewCommentsText/>
              </b:if>
            <b:else/>
              <b:if cond='data:post.allowComments'>
                <a expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><data:postCommentMsg/></a>
              </b:if>
            </b:if>
    
          </p>
        </b:if>
        <b:if cond='data:showCmtPopup'>
          <div id='comment-popup'>
            <iframe allowtransparency='true' frameborder='0' id='comment-actions' name='comment-actions' scrolling='no'>
            </iframe>
          </div>
        </b:if>
    
        <div id='backlinks-container'>
        <div expr:id='data:widget.instanceId + &quot;_backlinks-container&quot;'>
           <b:if cond='data:post.showBacklinks'>
             <b:include data='post' name='backlinks'/>
           </b:if>
        </div>
        </div>
      </div>
    </b:includable>
    </b:widget>
    
  5. Paste kode CSS + HTML tersebut pada blog yang lama, pada posisi yang sama antara:
    <b:widget id='Blog1' locked='false' title='Posting Blog' type='Blog'>
    

    Hingga ke:
    </b:widget>
    

    kemudian Save template, refresh blog dan lihat hasilnya, berhasil, dan masih perjuangan untuk mempercantik Breadcrumb dan sebagainya :-)
  6. Kemudian ternyata Googling ada forum diskusi yang membahas hal tersebut ada seperti ini:
    Hasil Pencarian topik Threaded Comment di Google
    Masuk ke halaman diskusi, yang ternyata banyak blogger juga merasa suka dan penasaran mencari solusi masalah sistem komentar blogspot pada template yang sudah di kustomisasinya. Hasilnya adalah seperti beberapa yang secara alami dilakukan di atas dan ada solusinya:
  7. Temukan:
    <b:include data='post' name='comments'/>
    
    secara hati-hati ganti dengan kode:
    <b:if cond='data:post.showThreadedComments'>
        <b:include data='post' name='threaded_comments'/>
    <b:else/>
       <b:include data='post' name='comments'/>
    </b:if>
    
  8. Selesai dan Well Done
Secara mudah dengan Browser Mozilla Firefox dapat langsung dipraktekkan, namun saya masih kesulitan ketika menggunakan Browser Chromium, bahkan hingga download memakai Browser Google Chrome untuk memencet tombol 'Reply' dan melakukan percobaan untuk menjawab komentar. Entah yang jelas mungkin sebentar lagi teratasi.

Selamat mencoba, Happy Blogging dengan sistem komentar terbaru dari Blogger.
Judul: Tutorial mengubah Threaded Comment : Komentar Bertingkat pada Template Blogspot Kustom atau Lama ; Ditulis oleh Bolo Srewu ; Rating Blog: 4.5 dari 5

2 komentar :

Post a Comment