Validate your Blog!

How to make your blogger.com blog validate.

Saturday, November 13, 2004

 

5. Display Comments

Problem:
If you have comments in a weblog entry, that entry's ItemPage will not be valid xhtml code anymore, because the comment deletion link uses & instead of &.

Solution:
First of all, publish a test entry. Then, do a test comment. On the entry's ItemPage, get the html source. Look for the code which inserts the comment delete icon. It should look something like this, just with different numbers:

<span class="item-control admin-53169609 pid-1116362449"><a style="border:none;" href="http://www.blogger.com/delete-comment.do?blogID=9139428&amp;postID=110036219453601414" title="Delete Comment" ><span class="delete-comment-icon">&nbsp;</span></a></span>

Copy and paste it into your weblog template, replacing the tag <$BlogCommentDeleteIcon$>. Now replace & with &amp;, and replace the postID number with <$BlogCommentNumber$>.

If you have any comments, the delete icon should produce valid xhtml code now.

9 Comments:
This post has been removed by a blog administrator.
 
This post has been removed by a blog administrator.
 
This post has been removed by a blog administrator.
 
Hey Moe,

First of all, thank you VERY much for sharing this information! I wouldn't have even known where to begin trying to fix this problem.

Secondly, I'm trying to validate a test blog I set up at http://microfish.blogspot.com/ and I could use some pointers. It's being hosted at Blogspot, so I can't use a separate CSS stylesheet. Thus, I can't be validated for XHTML Strict (so I'm going for XHTML Transitional), but even after applying all the information I got from your tutorial, I'm still getting four errors. Grrrrrr!

I would appreciate any advice you would be willing to give. I'm going to pass your awesome tutorial on to others. Thanks so much!
 
Hi!
Thx for your reply! Why can't you use XHTML strict with blogspot and css? This blog here is also a blogspot blog and does use css in the xhtml file ;-)
I think I might have found the first xhtml two errors of your blog: There's a paragraph tag right above your div id="profile-container". It doesn't close and I think it mustn't be there in first place.
Please delete that p and let me know if that helped.
Season's Greetings!
Moe
 
This site is a godsend... I was trying to figure out how to escape the ampersands in those URLs for the longest! Thanks for this. Check out my site at:

http://alphae.net/blog

Happy New Year!
o.~
 
Hey Moe,

Me again. ;)

I setup another blog here and chose a different template. The one I was using on the other site had HTML errors as well as the validation problems.

I was able to get this one to validate as XHTML strict, thanks to you. Thanks for taking the time to help me out. You're a great guy. :)
 
I'm glad to hear that! It's nice to know that some bloggers do care about valid code :)
 
Hey Moe, could you look at my blog and tell me if i can get rid of the 24 errors I have.Most of them are on add-on counters, but several are Blogger. I'd love to ba able to validate.

Bonnie Writes
 
Post a comment

<< Home

Archives

November 2004   January 2005   July 2005   Current Posts

This page is powered by Blogger. Isn't yours?   Creative Commons License   Valid XHTML 1.0!   [Valid Atom]
This work is licensed under a Creative Commons License.