SteveClason.com

Web Development & Stuff

Upgrading To Joomla! 2.5

Posted on by Steve Clason

I just upgraded three sites to Joomla! 2.51 using the instructions here. Things went well, but not perfectly. In all cases I had to click “Find Updates” after clicking “Purge Cache”, in one case I had to reload the install page before I could see any results. It sure could have been a lot worse.

A Handy WordPress Function: body-class()

Posted on by Steve Clason

This feature has been in WordPress since version 2.8 and we’re at 3.31 now, so this won’t be news to some, but either I didn’t need it until recently or had found a way to re-invent the feature well-enough for my purposes, so it’s new to me and valuable enough to deserve comment.

Simple code, just a PHP function inside the HTML body tag, deploys the feature in a WordPress template:

<body <?php body_class($class); ?>>

The variable $class is an optional space-separated list or array of class names that will be applied as attributes to the body tag when WordPress renders the template. More usefully, though, the method also echoes some WordPress-generated classes that identify the page being viewed, among other useful things.

There’s a long list of these WordPress-generated class names on the WordPress Codex page, but I’ll just illustrate it via the context in which I put it to use.

While adapting a bare scheme I have to meet a client’s requirements, I used a faux-column technique to house a widget-enabled right-sidebar. The client, though, needed an option to remove that sidebar on some pages with wide content (forms that couldn’t easily be changed), so I made the template option “one-column-page.php” which didn’t invoke the sidebar.

Now, using >, selecting that template causes the class “page-template-one-column-page-php” to be added to the body tag and I can use a style-sheet rule to disable the background-image that defines the faux-column:


#pageWrapper {
background-image: url("images/gold_240x10.png");
background-repeat: repeat-y;
background-position: right;
}


/* Disable faux-column if using one-column-page template. */
body.page-template-one-column-page-php #pageWrapper {
background-image: none;
}

Had I needed, I could have used the same technique to change the dimensions of page elements to accommodate the additional space created by removing the sidebar. Pretty handy, and that just touches the surface.

Microsoft Pushing Internet Explorer Updates

Posted on by Steve Clason

According to an article at Slashgear, Microsoft will begin pushing updates for old versions of Internet Explorer in January, 2012. Although users will be able to prevent, or to roll back, the updates, they will need to take positive action to continue using old versions.

This welcome action — welcomed by every developer I know — won’t cause those versions to disappear, but will make them less popular, and provide a rationale for convincing clients to forgo the time and expense, and downright silliness, of supporting them in their websites.

Secure WordPress

Posted on by Steve Clason

Smashing Magazine has a good article (with some good links, as well) on “Securing Your WordPress Website“. It takes some work to recover from a hack (I know) — more than it takes to put some minimal secutrity in place.

Big Change to Google Search

Posted on by Steve Clason

In 2010, Google made a huge change to it’s search algorithm (that’s all the behind-the-curtain calculations that go into deciding what results to show for a query string). Yesterday they announced, via a blog post, a tweak to that algorithm which will give preference to more recent results on some kinds of searches–that is, if they determine that a query will benefit from newer sources (say, a search for “Occupy Wall Street”) they will deliver newer results at the expense of relevance.

Google estimates 35% of searches will be affected. That’s a huge number.

Making WordPress Plugins

Posted on by Steve Clason

Another good article from Smashing Magazine, this one by Daniel Pataki on creating WordPress plugins. The usual stuff — clearly written, concise instructions for necessary skills.

HTML5 For Journalists?

Posted on by Steve Clason

This strikes me as a little bizarre. The popular (and excellant) website HTML5 Doctor posted some Frequently Asked Questions in the hope of, they say, providing accurate information about HTML5 for “journalists and analysts”.Does a mark-up format really need a public relations effort?

The basic approach (from the journalist’s perspective) is “What is this thing and why does it matter to my readers?” Telling is the Q/A “Will HTML5 Kill Mobile Apps”, which I believe is the MAIN question business analysts are asking — their answer is that HTML5 is way better than native OS apps because of interoperability.

Obviously there’s some persuasion going on here. I agree with the point of view, but still…

One Reason Why HTML5 is Flying High

Posted on by Steve Clason

HTML5 is growing so fast that standards organizations can’t keep up and definitions seem to be constantly lagging implementations.

One reason (there are many) is that Apple’s policy of raking 30% of the profits for mobile apps they sell in their iTunes store motivates content-creators to avoid the native OS applications, relying instead on the mobile browser’s functionality to deliver the content and pay the fees, and so keeping that 30% for themselves.

The Boston Globe has launched a new subscription-based Website that does just that. From EditorsWeblog.org:

The HTML 5 format allows the paper to offer something which looks like an app, fells like an app, but is in fact a website that can re-size and reformat based on whatever device the page is being viewed on. This means that readers can access the site without downloading an app from the iTunes store – meaning Apple don’t get to keep that healthy 30% slice of the subscription pie.

The Canonical Accessibility User

Posted on by Steve Clason

The W3C has released a draft document describing an “accessibility user” for web-based audio and video content. While not exactly easy reading, the document provides some insight into the needs of sensory-impaired users, needs which most of us, even those developers who have thought about and dealt with these issues some, tend to “handle” in real time while we’re coding for our own sense of a “standard user.” Which is to say, we don’t think about their needs much or correctly.

The report is here: Media Accessibility User Requirements

Being Good To Long-Term Clients

Posted on by Steve Clason

Shane Pealman tells us to  “Marry Your Clients” over at A List Apart. While I’m not likely to duplicate some of his techniques (I don’t see a roof-top BBQ in my future), I certainly agree with his general advice to explicitly nurture our long-term clients to the same sense of purpose with which we pursue new clients.

One specific suggestion he makes that I really like is to schedule some weekly time to reflect on how best to maintain, or improve, your existing relationships, and then to follow up with action.