A couple of days ago I saw one of Garry Conn's posts related to tips about image positioning in a post. One issue that I expressed my opinion on was the fact that the ID attribute of an element needs to be unique on a web page. This is due to the fact that the page will not validate otherwise. Garry replied that he is not at all worried about validation issues, because they are irrelevant to SEO (Search Engine Optimization). What this means is that no matter how many errors a web page has, it will still be indexed and displayed in Search Engines as long as the bots can crawl it's content. I'm sure he's right about this and it's every webmasters choice if he should care about validation or not.
But that's not the reason behind this post. Garry also pointed out that this blog, my beloved "The Yoboo", was also not validating according to the W3C validator. In fact, the homepage had more than 400 errors. That disturbed a little because I'm one of those guys that do care about validation. And with that in mind I set off to fix things.
The first issue I encountered was the fact that this template used a XHTML Strict DOCTYPE. As stated on A List Apart: "a DOCTYPE (short for "document type declaration") informs the validator which version of (X)HTML you're using, and must appear at the very top of every web page. DOCTYPEs are a key component of compliant web pages: your markup and CSS won’t validate without them." Many of the errors were triggered by the fact that the template used an Strict DOCTYPE, rather than a Transitional one. Another way to say this would be: is was formatted as a Transitional XHTML, but declared a Strict DOCTYPE. No problem. This was easily fixed replacing the original declaration with:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
That apparently solved a lot of the validation errors. Now I was down to about 70 remaining. I started to fix the ones that repeated the most. One of them was "document type does not allow element 'p' here". This was caused by the fact that the body of a single post was defined by a P element(paragraph). And inside this paragraph there were several others which represented the header of the post, the content of the post and it's footer. According to the W3C standards, this was an error, so for a easy fix I replaced inside the template the paragraph elements with DIVs. I replaced the sections of the post also because I plan to use standard formatting in the future, rather that the way Blogger does things (I'm talking about the <BR> tags for separating paragraphs). So I also went to Settings in the Blogger Dashboard and under Formatting I've set the "Convert line breaks" option to "No". This of course means that I will need now to reedit all the posts and split them up in paragraphs. I'll do that some day.
After these modification there were only about 30 errors remaining. The problem with these is the fact that they're caused by the Blogspot engine itself. Due to some bad and reckless coding I had a lot of unescaped &'s. Most of them were caused by the blog Pager, the little thing that helps you get back and forward through posts. Because I wanted to get rid of all the errors, at least the ones on the front page, I commented the pager so it will not appear anymore. I'll decide if I'll place it back on the blog. Maybe by the time I do that, it will be valid XHTML.
A few more errors were caused by the fact that the Blog Achive was displayed using Hierarchy style. Switching that to "Flat List" solved the remaining of the errors so the homepage was validating. But I rather liked the Hierarchy style of displaying the archive so I hope that will be fixed as well.
After seeing the beautiful green bar I tried a few more things to make sure there are no more errors, but there were. Another issue arises with the fact that I've opted for inline comments. This creates an IFRAME element which again trows unescaped characters errors. But since I find this feature very useful, I'll let it pass.
And that's the way I managed to validate most of "The Yoboo". Who would have thought that a Blogger/Blogspot template would have so many problems? Of course there are other people that are complaining about these issues, but it seems there is no one there to listen to them. Oh well, at least my blog has the green light to some extent.
6 comments:
July 17, 2008 5:07 PM
Hey there, good work. It validates well. You have done work on the comment spot right. All the best. Its sad that they are not making enough changes to their software. Do you believe this will have some effects in the PageRank? I have seen that high ranking sites are mostly free of errors, and there is not one blogspot blog that ranks above 7.
July 18, 2008 9:46 AM
Hi there Lenx. Thanks for stopping by.
I doubt validation has some effect on PageRank, seeing as this mostly takes into consideration the quantity and quality of inbound links. But still, I consider that a web site that validates has less worries when it comes to changes to the HTML/XHTML changes that are bound to appear soon. And if you can follow the specifications, I don't see why you wouldn't.
One hope I have is that with the improvements that will be brought with Blogger in Draft, we will see some fixes to their engine. Maybe then, we will get rid of all the validation errors and we will be able to enter Web 3.0 with our heads held high.
July 18, 2008 5:53 PM
It's really nice to get validated. I hope they make the changes soon. Mostly the problems are in the comments and trackback URLs ad also the blog archive. I don't like removing them, and so I have now 36 errors remaining. Even google has sixty errors and Microsoft 180 makes me brave!!
Of course, hoping to enter web3 with head held high as you say!
Lenin
August 9, 2008 11:20 PM
I'm working on validating my blog. I have cut my errors in 1/2 using your method and doing some general 'clean up.'
Now I am at 264 Errors, 38 warning(s)
Still trying to get rid of them. I'll keep at it.
PS: I see you're validated! Great job!
Maybe an updated post about how you went about doing this?
August 10, 2008 12:14 PM
Sorry for the delay Taylor, I was away the last few days and I'm getting ready to leave on vacation tomorrow. So I won't be spending too much time around a computer for about 2 weeks.
Regarding the validation part, the best way to go about it is to run your site through the W3C validator and look for the errors it reports. You try to fix the ones that repeat the most. For example, to have more than 200 errors on a page could indicate that you have either an incorrect doctype declared or maybe missing a closing tag.
Because I wanted at least the front page to validate, I went drastic about it and cut out everything that wasn't working and couldn't be fixed.
I'm sorry but I don't have a lot of time right now. You could also check out Lenin's Cute Writing blog and his story of validation. Maybe he can help you out.
Again, I apologize, but I have to run. I'll be back in two weeks.
October 2, 2008 7:13 AM
Thanks for this great post...I am working on cleaning up our blog using your tips.
Post a Comment