Current version is 18.104.22.168 released on 2007-04-17
- What This Plugin Does
- Installation Instructions
- How To Use The Tags
- Frequently Asked Questions
- Version History
This plugin will validate your web pages on the fly when published from Movable Type. The validation is done live against the W3C’s Markup Validation Service by sending your newly published page. A compliant page will then include a badge from the W3C. A non-compliant page will not display a badge.
This plugin was built to address the issue of many web pages claiming to be compliant but are not. They probably were at one time, but as you post things to your blog, you may post non-compliant code now and then and become uncompliant. This plugin makes sure your pages are compliant, before you claim it! Now, if you notice the badge missing from your page, you know something is wrong.
This plugin is not intended to be a tool for debugging and diagnosing why you are not compliant. That is what the W3C’s Markup Validation Service is for. Go there and enter your page name if that is your goal. The goal of this plugin is to just quickly check if you are compliant or not and show the badge when you are compliant.
- This plugin works with Movable Type version 3.3 and higher.
- Perl version 5.8.5 or higher. This is what I use. It may work on lower versions. Let me know if it does and I will lower this.
- This plugin will only work in static (not dynamic) templates.
- Download the latest version of the plugin.
- Unzip the contents of the file.
- Copy the file W3CValidator.pl to your Movable Type “plugins” directory.
(If you don’t have a plugins directory, create a plugins directory in the same directory where your mt.cgi file is located. Then upload W3CValidator.pl into the newly created plugins directory.)
- Give me some credit. You have many choices. Do one or all! 1) Add a trackback link to this page on your page. 2) Donate so that I continue to enhance this plugin.
This plugin will only work in static (not dynamic) templates.
A container tag that should surround the entire contents of your page. Ideally, this should be the first and last tag in your template file. All output between these tags is used in the validator.
This tag returns the standard image HTML as recommended by the W3C for valid pages. Place this tag within the MTW3CValidate tags where you want the image to appear. If the page is not valid, this tag returns nothing. This tag must be placed within the container MTW3CValidate.
A container tag that allows you to specify your own HTML for the valid badge instead of using the default HTML recommended by the W3C. Some people like to use other smaller images or save the image to their own server. Place these tags within the MTW3CValidate tags where you want the image to appear. If the page is not valid, these tags returns nothing. This tag must be placed within the container MTW3CValidate.
A container tag that allows you to specify your own HTML for the invalid badge. If the page is valid, these tags returns nothing. This tag must be placed within the container MTW3CValidate.
A tag that prints out the HTML returned from the validator. If your page is not validating, this should give you information on why its not working. This tag should only be used to debug your installation if you are having problems. This tag is not meant to be an every day debugging tool for invalid pages. You will want to just use the validator for this. A word of caution, this tag will blindly insert the contents of the validator response into your web page — that combination is guaranteed to be invalid because its a page within a page. Again, this is only a debugging technique. This tag must be placed within the container MTW3CValidate.
- Q: Are there any other plugins that can help me format my entries to be XHTML-compliant?
A: Yes, I use and recommend SafeHref to help encode URLs that I put on my pages. URLs are normally the number one thing that breaks compliance. Its a great help. You can also use Amputator to fix those pesky ampersands.
- Q: This plugin (and others) don’t seem to be working on my server. Why?
A: Internally, Movable Type requires some Perl modules to be installed for plugins to work. Some servers do not have these modules installed by default. Please run mt-check.cgi on your server to find out what you are missing.
1. In this simple example, we create a page that is validated and has the badge displayed.
<MTW3CValidate> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Virtual Library</title> </head> <body> <p>Moved to <a href="http://example.org/">example.org</a>.</p> <MTW3CValidBadge> </body> </html> </MTW3CValidate>
2. In this simple example, we create a page that is validated and has a custom badge displayed.
<MTW3CValidate> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Virtual Library</title> </head> <body> <p>Moved to <a href="http://example.org/">example.org</a>.</p> <MTW3CValidBadgeCustom> [My page is XHTML-valid, dude!] </MTW3CValidBadgeCustom> <MTW3CInvalidBadgeCustom> [My page is NOT XHTML-valid, dude!] </MTW3CInvalidBadgeCustom> </body> </html> </MTW3CValidate>
If you enjoy using this plugin and/or would like to see it enhanced, please donate a buck or two…or fifty. I will use the money to buy my wife dinner so she lets me keep working on this stuff for free and does not complain.
This software is licensed under the CC-GNU LGPL.
Download the current version from the link below. Past versions are not archived.
22.214.171.124 — 2007-04-17
- Updated to use W3C header parsing instead of page for results.
126.96.36.199 — 2005-09-04
- Updated plugin info to take advantage of MT 3.2 enhancements.
188.8.131.52 — 2004-12-10
- Fixed bug where plugin reported error in MT-Medic.
184.108.40.206 — 2004-11-11
- Fixed defect where errors generated by other tags within MTW3CValidate tag did not show errors correctly.
220.127.116.11 — 2004-01-02
- Made compatible with Movable Type 3.0.
0.37 — 2004-01-02
- Change URL link for plugin.
0.36 — 2003-11-20
- Added an “Unable to connect” message in the place of all the tags when your server cannot connect to the validator service.
0.35 — 2003-11-19
- Added the MTW3CValidatorOutput tag to help people debug their site.
0.31 — 2003-11-03
- Removed the border attribute from the built-in validation badge because its not valid XHTML-Strict. I use XHTML-Transitional on my pages so I didn’t notice.
- Added copyright notice for tracking usage.
0.30 — 2003-10-19
- Added ability to specify custom HTML for invalid badge.
0.20 – 2003-10-14
- Added ability to specify custom HTML for valid badge.
0.10 — 2003-09-24
- Works for me.
For questions, suggestions, bug reports, and anything else related to this plugin, please e-mail firstname.lastname@example.org or leave a comment.