Threaded Comments Coding

Wednesday, July 25, 2012

It took me a few days to get threaded comments to work on my Blogger blog. Of course, if you don't have a custom template it's as easy as checking a couple settings. You should always make a backup of your template before attempting any changes to coding - just in case you mess it up.



First you need to make sure you are using the embedded comment form and allow full feeds. These settings are under two different categories in the Blogger settings.

If you still can't see a reply button then you're going to have to do some surgery on the html for your template.

OR

You can decide you don't care about any of the customization you or the original template author created and hit the "revert widgets" button. This will reset ALL of your widgets. Since I rather like my widgets I went the long route. You have to make sure you have the "expand widgets" box ticked to update this code:

Find this snippet in your html:


<b:if cond='data:blog.pageType == &quot;item&quot;'>       
  <b:include data='post' name='comments'/>       
</b:if>             

And replace it with:

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

In my case after I did this I still didn't have a reply button so I had to go in and add even more code. I also don't like the fact that just using the above code sticks you with the system default style (which didn't mesh with my own template). This is just the syle I used - you can dink with the settings and get it how you want it to look:

Look for this code:
]]></b:skin>
And directly above it add:
.comments {
  clear: both;
  margin-top: 10px;
  margin-bottom: 0px;
  line-height: 1em;
}
.comments .comments-content {
  font-size: 12px;
  margin-bottom: 16px;
font-family: Verdana;
font-weight: normal;
text-align:left;
line-height: 1.4em;
}
.comments .comment .comment-actions a {
background:#1F9EE5;
cursor:pointer;
color:#ffffff;
padding:2px 3px; margin-right:10px;
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius:6px;
font:9px sans-serif; border:1px solid #1F9EE5;

}
.comments .comment .comment-actions a:hover {
  text-decoration: none; background:#5AB1E2; border:1px solid #5AB1E2;
}
.comments .comments-content .comment-thread ol {
  list-style-type: none;
  padding: 0;
  text-align: none;
}
.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: 40px;   font-size:12px; background:#EBF5FE;
}
.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:none;
}
.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,iVBORw0KGgoAAAANSUhEUgAAAAc AAAAHCAYAAADEUlfTAAAAG0lEQVR42mNgwAfKy8v/48I4FeA0AacVDFQBAP9wJkE/KhUMAAAAAElFTkSuQmCC&quot;) no-repeat scroll 0 0 transparent;
}
.comments .thread-collapsed .thread-arrow {
  background: url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA AcAAAAHCAYAAADEUlfTAAAAJUlEQVR42mNgAILy8vL/DLgASBKnApgkVgXIkhgKiNKJ005s4gDLbCZBiSxfygAAAAB JRU5ErkJggg==&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>

To change the background of Reply button in Active mode edit 1F9EE5
To change the background of Reply button in Mouse Hover mode edit 5AB1E2
To change the Font colour of the Reply text edit ffffff
To change the background color of the Reply comments container edit EBF5FE


This worked for me because blogger did not automatically add the code above (which they should have when I added the threaded comment coding) I'm still not happy with the way they look. I want to add the paper background to the comments area but that's a abttle for another day. Hopefully this will help all of you who are also have difficulty.

All of the information above was gained from at least 4 different websites - I saved it to a notepad file so I have no idea where to put the credit for it all.

1 comments:

Found it - thanks! I didn't realize my feeds had to be set to "full." I'll try changing that first, of course.

Post a Comment

Instagram Feed

 
 
 
Always remember - Pike - Passed away 2010 surrounded by love and light.

Always Remember - Gobie - passed away 4/25/15 surrounded by love and light.

Always Remember - Cuda- passed away 5/19/15 surrounded by love and light.

Always Remember - Anchovy - passed away 9/12/16 surrounded by love and light.

2016 Travel

 
Blogger Widget