Ampersand validation issues with Joomla

Joomla! is, in many ways, a great CMS. One of its shortcomings, however, is that it has been slow to adopt web standards, which frequently manifests itself in annoying validation issues with generated XHTML and XML feeds. These issues are usually fairly easily overcome, but it would be nice if you didn’t have to worry about them in the first place.

The default WYSIWYG editor, for instance, seems to purposely prevent you from entering your ampersands (&) as & which is required for XHTML validation. The way around this is simply to use a different editor; namely, JCE, or the Joomla! Content Editor. JCE will, among other nice features, automatically appropriately encode your typed ampersands, making it easier to ensure your code validates.

One annoying “feature” I’ve encountered with JCE so far, though, is the inability to insert empty alt attributes. Often, particularly in the case of an icon that is more than adequately explained by surrounding text, adding alt text would actually just be at best redundant and at worst confusing to people using screenreaders. However, to validate, you have to include an empty alt attribute (alt=""). JCE doesn’t seem to like this, and will strip your empy alt attribute. I’m sure there is a relatively simple hack to circumvent this.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.