Feeling validated

After feeling pretty pleased that I had so easily switched from the old site’s templates to MT4’s, I spent this weekend fine-tuning my sidebar and transferring static pages into the MT4 content management system.
Then I decided to check out how valid my pages were. Horrors! I had 128 errors.
WTF?! My new blog template has 128 errors?!
The majority of errors were caused by Movable Type code, with problems popping up in all sorts of templates, modules and widgets.

The ‘abbr’ tag in each post’s timestamp had some invalid parameters which I deleted and so far it doesn’t seem to have affected the blog. There were class names for styles I couldn’t find listed in the stylesheets. It seemed to be system-generated because the style names took this form: class=”style-name [space] sub-style-name” and I am not sure if we allow for styles with spacing between them! Anyway after I deleted them, nothing seemed to happen.
(Aside: I also noticed these complicated style names with spaces between them, when I was working on my new church website, which uses Joomla, another content management system. Lots of new style names were being generated that we couldn’t find in any of the stylesheets. In fact the developer and I still could not clean up all the weird styles because we didn’t know where to search!!)
As I’ve been blogging for several years, my monthly listings were pretty long, so I switched to the Monthly Archives dropdown menu widget instead. However, it too generated errors as it had two consecutive ampersands in the code. I don’t understand why they needed to be there because I’m no developer, added the ‘amp;’ crossed my fingers and the dropdown menu still works.
After fixing all the MT4 template validation errors, I turned to the stuff I had knowingly embedded. There was a YouTube video which I hadn’t bothered to fix yet. It is troublesome validating YouTube code everytime I want to insert a video. However on doing some quick Googling, I found [this service](http://www.tools4noobs.com/online_tools/youtube_xhtml/) where you can paste your YouTube embed code in, and generate valid code!
[Twitter](http://twitter.com/), as usual, was another big culprit, with ampersands galore. It also uses the outdated ’embed’ tag. I figured out how to convert this into valid ‘object’ code and now Twitter is causing no more validation problems. Thanks to [Poolie](http://pooliestudios.com/) for the [original valid Twitter Flash code](http://poolie.kulando.de/post/2007/04/11/twitter_flash_badge_jetzt_auch_validiert), which I adapted for the ‘Twitter with friends’ widget, and to Dom for [sending me Poolie’s tip via Twitter](http://twitter.com/dominik/statuses/47106742) last year.
The next thing I’m going to do is to convert some of the MT include templates to PHP includes, which are more flexible. I don’t want to keep re-publishing every single page to reflect the latest updates on my sidebar. I’ve always wondered why MT (including earlier versions) structured its templates in a less dynamic way, unlike WordPress. I’m no expert and have missed out some advanced feature, so I’ll stand corrected if you have anything to point out.
The [latest beta version of MT4](http://www.movabletype.org/2008/04/movable_type_415_beta_1_now_av.html) apparently aims to address user complaints that the template structure is too complicated. I totally agree. If you’re a developer, MT isn’t a problem, but for many of us it can still be daunting. Of course, you must have some level of skills to have installed MT on your server in the first place. But MT can still be simplified.
As of this time of writing, my home page, at least, is valid. [Go check](http://validator.w3.org/check?uri=http%3A%2F%2Fvantan.org).


  1. Miccheng

    For class=”style-name [space] sub-style-name”
    The [space] is actually used to apply multiple styles to the item.
    font-family: Arial, “Times New Roman”, Courier;
    font-weight: bold;
    Applied to an object:
    <blockquote class=”txtFont txtB”>This is my text</blockquote>
    This way, you can have <blockquote> that uses just “txtFont”… and u can apply the “txtB” class to bold one particular blockquote.

  2. vantan

    Thanks MicCheng. I’ve obviously been out of touch, now that I don’t do coding work.
    Still, I like to keep my styles simple, preferably not too intertwined. Never liked going through other people’s code to make changes, cos they think differently.

Comments are closed.