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.

Consequences of bot-mediated reality

I have a lot of catch-up listening to do with regards to The Long Now Foundation‘s excellent Seminars About Long-term Thinking (SALT) lecture and podcast series. I’m a charter member of the Foundation, which gets you a sweet membership card and access to video of their lectures, among other less tangible things like knowing you’re helping inject some much-needed awareness of long-term thinking and planning into public discourse.

One of the lectures I’m particularly looking forward to downloading is the recent Daemon: Bot-Mediated Reality by Daniel Suarez, which I think has particular relevance given the recent and rather large f-up in which Google’s news crawler inadvertently “evaporated $1.14B USD”.

Unfortunately, I think that in the near future, as more and more processes are automated, we will see more such screw-ups of this scale. I can’t help but think that this might have been avoidable, though, if the indexing engine had been able to take advantage of semantic data rather than relying on scraping and evaluating natural language.

Amazon Web Services Start-Up Tour in Toronto

Attended this event at the MaRS Discovery centre,  informative as always (I was at another AWS event last year that was smaller scale), which was hosted by Prashant Sridharan, Director, Amazon Web Services and Mike Culver, AWS Evangelist, with presentations from:

  • Carlos Barrettara, Co-Founder, Polar Mobile
  • Ilya Grigorik, Co-Founder, AideRSS
  • Chris Thiessen, Founder, Zoomii
  • Paul Bloore, CTO, Idee
  • Farhan Thawar, Chief Software Architect, I Love Rewards

While all the presentations were interesting and full of the usual architecture diagrams (slides on are forthcoming, apparently), my faves were from Chris Thiessen of Zoomii and Paul Bloore of Idee, just because their stuff was so cool.

Zoomii brings the feel of browsing a real bookstore to the web, and does a pretty good job of it. Even on slowish machines and/or slowish internet connections, the UI is pretty smooth. Also impressive about this presentation was that Thiessen, who also blogs, had rolled his own HTTP server and database (if I recall correctly), among a bunch of other things.

Paul Bloore of Idee showcased TinEye, an image search engine (currently in beta) that actually searches the pixels that comprise an image rather than (as Google does) the text around an image. The engine seems to be pretty robust, and did some impressive matching on images of low quality, and in significantly altered states. Bloore demoed one of the cooler features, which was an iPhone app that allows you to take pictures of things–in this case, a CD cover–submit it to TinEye for processing, and get a bunch of results related to the product which, in this case, was the option to buy the album from the iTunes store, though other typical results would include reviews.

If only Spore DRM complainers were this vocal about all corporate injustices

As of this writing, Spore, the new game from Maxis and Electronic Arts, has generated 2,015 1-star reviews on The reason for this being EA’s rather draconian (can only install on three machines without calling tech support, computer needs to check-in to EA activation servers) and useless (it was pirated a week before its launch anyway, and the DRM only annoys legitimate customers) Digital Rights Management (DRM).

While many of the complaints are valid, I can’t help but feel like their legitimacy is overshadowed by the fact that >90% of these complainers would probably never get so riled up about, say, an Amazon product that was produced under exploitative or dangerous working conditions, that seriously threatened biodiversity, or that leached toxic checmicals into landfills when you were done using it.

No, these people will only get fired up if their video game doesn’t work just right. Don’t be surprised if I don’t have a lot of sympathy.

Maybe Naomi Wolfe is right…

I’ve always been very hesitant to use extreme terms like “police state,” or especially “fascist,” when describing political developments in countries like the USA and the UK that are slowly but steadily eroding citizen’s rights and encroaching on their privacy. But maybe Naomi Wolfe is on the right track after all, with her current ideas around the End of America.

With all the news about illegal wiretapping going on and now this, I’m beginning to change my mind:

Reason 3 not to vote for the Conservatives: who cuts literacy funding?

We could be doing worse, but research does show that Canada has a literacy problem.

So, if that’s the case, why would the Conservatives cut $17.7 million CDN from adult and family literacy programs? This is old news, but it made no sense then, and it still doesn’t. Adult literacy has a very direct and measure impact on the economy. From ABC Canada:

A rise of one per cent in literacy scores relative to the international average is associated with an eventual 2.5-per-cent relative rise in labour productivity and a 1.5-per-cent rise in Gross Domestic Product (GDP) per person, according to Statistics Canada.

So as Canada is possibly heading into recession, might it not make sense to restore some of this funding to its previous level, if not increase it? Unfortunately, the Conservatives have been fairly consistent in their disregard for evidence-informed policy and common sense.

Better pagination SEO with WordPress

Though SEO doesn’t get me all hot and bothered like it does some people, it is on my radar, as I think it should be for all web designers and developers.

One of the blogs I’ve recently subscribed to is SEOMoz, which I like both because it seems to be run by real professionals and thus avoids a lot of the sketchier, black/gray hattish SEO techniques, and also because it seems to have fairly good user comment discussions.

I was particularly interested by a recent “Whiteboard Friday” post in which SEOMoz CEO and co-founder Rand Fishkin discusses an SEO issue with pagination that had arisen with a client. While the blog post title, “A Farewell to Pagination” may be going a bit overboard, there were some definite good points, which basically revolved around the notion that extended pagination in which a website may have hundreds of pages going back years that are all organized in reverse chronological (or some other order) and accessed via pagination can be bad not just for navigation, but also for SEO.

Diving deeper and deeper into the site this way successively dilutes your link juice for the search engines that are crawling your site, potentially leading them to abandon including the deeper/older pages in their index, leading to their exclusion from search results. Fishkin discusses some navigation workarounds that are improvements both from an SEO and user experience point of view.

Applying this to WordPress, I wondered if there was a WordPress filter hook that would allow you to create a simple plugin that could appropriately add the rel="nofollow" attribute to your pagination anchor tags, so that pagination is still available to the user but won’t have the deleterious SEO effects. Turns out there isn’t, but there’s another easy, though less elegant, way to accomplish this, which is by defining a function in your WordPress templates’ functions.php file.

Just copy and paste the previous_posts_link and next_posts_link functions from wp-includes/link-template.php into your functions.php file, and make the following simple modification

function nofollow_next_posts_link($label='Next Page »', $max_page=0) {
	global $paged, $wp_query;
	if ( !$max_page ) {
		$max_page = $wp_query->max_num_pages;
	if ( !$paged )
		$paged = 1;
	$nextpage = intval($paged) + 1;
	if ( (! is_single()) && (empty($paged) || $nextpage <= $max_page) ) {
		echo '<a rel="nofollow" href="';
		echo '">'. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>';

function nofollow_previous_posts_link($label='« Previous Page') {
	global $paged;
	if ( (!is_single())	&& ($paged > 1) ) {
		echo '<a rel="nofollow" href="';
		echo '">'. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>';

With that done, simply use the new functions wherever in your template you want the nofollow functionality (e.g. in index.php). This is really only the beginning of a solution to this issue, as you’ll have to rework other aspects of your navigation if you really want to add rel="nofollow" to all your WordPress pagination.