Image by RXAphotos
Read the first part of this post: Attempt to validate a default Blogger template (I).
5. This error is caused by an unescaped ampersand ('&') at the import of a dynamic CSS file (http://www.blogger.com/dyn-css/authorization.css?targetBlogID=xxx&zx=xxx
). The import is not present in the source HTML, so it is added later. We'll just leave this one alone for now.
6. Many times declaring an incorrect Doctype messes up you entire validation. In this case there was a Strict Doctype declared, but the template included iframe tags (navbar). So I replaced
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">with
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">.Remaining 68 Errors and 62 Warnings.
7. Some of these error are displayed by the "Edit post" button when you are logged in. Comment or delete the line <b:include data='post' name='postQuickEdit'/>
. Others are displayed by the comments link at the bottom of the post. I describe how to fix these lower down the page.
Remaining 64 Errors and 58 Warnings.
8. These are personal and intentional errors to accentuate the fact that your posts also need to be written in valid html/xhtml. I added the alt attribute to the image and changed the closing tag to />. This needed to be done in the body of the post, not in the template.
Remaining 58 Errors and 58 Warnings.
9. Errors disappeared because of previous modifications
10. A lot of errors caused by the "Quick Edit Widget" buttons. I removed all of them by commenting them. A easy way to do this is to search for name='quickedit' inside the template and comment the entire element (<b:include name='quickedit'/>
).
Remaining 39 Errors and 39 Warnings.
11. Problems caused by the fact that the archive is displayed as Hierarchy. The easiest way to fix this is to change the way the Archive is displayed. For this go to Layout - Page Elements and edit the "Blog Archive" gadget. I changed the Style parameter to Flat list.
Remaining 8 Errors and 8 Warnings.
12. Errors disappeared because of previous modifications
13. Errors caused by the unescaped ampersands in the dynamic css and the comments link. Note that there would be more errors if you have more posts on the specific page you validate (or less if you have less posts). This is the tricky part. Let's start with the comments.
Find the line that says:
<a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'>
The problem is with the expression
expr:href='data:post.addCommentUrl'
. This gets replaced by something like http://www.blogger.com/comment.g?blogID=xxx&postID=xxx
and the problem is the unescaped ampersand. To fix this change the expression to this:expr:href='"http://www.blogger.com/comment.g?blogID=xxx&amp;postID=" + data:post.id'
where xxx is the id of your own blog. You can find out what your blog id is by viewing the current link. Note the hack that i used after blogID (&amp;). This is because of Blogger's engine: every & is replaced with &, but luckily the engine goes over the template only once. While this is a feature in blog posts, it's a problem in URLs. They do work, but they don't validate. This same method can be applied for "Email post" links if you have that activated. Just make sure you replace "comment.g" with "email-post.g"
Remaining 3 Errors and 3 Warnings.
14. Errors disappeared because of previous modifications
Now the only problems that remain are caused by the loading of a dynamic CSS file. From what I know this is a new "feature" and can not be removed. This first checks whether you are logged in to Blogger and according to that it creates a specific set of CSS rules. And because of the way it is added to the template, it makes it impossible to fix. Unfortunately, this also prevents my Yoboo from validating. And I was so happy when I saw that green bar a while back :(. I'll keep on looking for a solution to this. If anyone has any ideas, you're more than welcome to share.
And that's about all I can do for now (due to lack of time and mood). Note that I focused solely on the front page. It's very possible that other pages still have errors. I hope this helps you minimize the errors you encounter in your own validation experience. If you find that I missed something or you know of other ways to do things, please tell me your own methods to validate a Blogger template.
Get Social Share 2.0!