The Mobile Web Part 3: iPhonitizing Your Site Sans MoFuse

In part two of the “The Mobile Web” series, I covered MoFuse, a service that automatically generates (and hosts) iPhone and WML versions of websites for you. Today we will be doing something a little more interesting. Today we will be putting together iPhone-formatted sites without the help of a hosted service.

Option 1: Use a WordPress Plugin

If you’re blog is powered by WordPress, you’re in luck. There are a couple of plugins out there to help make your blog iPhone-friendly.

Both of the plugins automatically detect whether the user is coming to the site via iPhone and render the blog with their own included iPhone themes. WPtouch also allows the reader to toggle between iPhone-formatted and normal versions of the site. (iWPhone does not have this feature yet.)

Option 2: Code it Yourself

Note: I will not be providing complete sample code, and I won’t be covering every little detail of the process. The following is intended for people who have some knowledge of PHP or *insert web language here*.

First, download a CSS/JavaScript iPhone interface. There are a few out there, such as iUI, CiUI, and iPhone Interface in JavaScript. (My favorite is CiUI.)

Once you get the feel for how the interface works, start writing a back-end for it. Use your favorite scripting language to pull the content into the interface. There are two ways to go about this:

  • Access the database, query the posts, then display them.
  • Use SimplePie or SimpleXmlElement (in the case of PHP) to parse the RSS feed and write the items into the page.

Both options are generally easy enough if you know what you’re doing, and work well. If you want as much control over the final product as possible, this is the way to go.

Further Reading

Come back on Sunday for the next installment in The Mobile Web.