Hacks : Unrecognized Tag Warning 2.0 Feb 19 2003 | # | C:5

Unrecognized Tag Warning 2.0

February 19, 2003 - updated February 8, 2006

When MovableType parses templates, it looks at every tag that begins with MT (or $MT). If the tag is recognized by MovableType - or an installed plugin - then the tag and its contents are processed and displayed in the resulting page.

However, if the tag is not recognized, MovableType quietly discards it, and you’re none the wiser unless you notice that the generated page is not correct.

This hack modified MovableType to display an error whenever it encounters an MT tag it does not recognize. This enables you to catch problems with your templates whenever you rebuild you pages.

lib/MT/Builder.pm Modification

Go to your MovableType installation directory, and open the file Builder.pm in the lib/MT subdirectory. Find the line that says:

            my($h) = $ctx->handler_for($t->[0]);

and insert the following line after it:

            return $build->error("Unrecognized MovableType tag <MT$t->[0]>") unless $h;

In MovableType 2.5 and 2.6, this modification is on line 115.

Version History
  • 2.0 April 16 2003
    Use $build instead of $ctx for reporting errors.
  • 1.0 February 19 2003
    Initial hack.
The site database appears to be down.