A Billion Suns archives or learn more about the site

Latest Stuff

Migrating Textpattern Designs

Posted Sep 29, 2009 in Design Comments 0

Textpattern is a content management tool for blogs and small websites. It allows site designers to exercise a great deal of control over the layout and functionality of websites through a highly expressive template language modelled on XML markup tags.

One downside of TXP, however, is that the templates are all stored (along with page content and sometimes the CSS file) in the TXP database have to be constructed almost entirely inside TXP’s administration interface:

Now, editing code directly in browser textareas isn’t the worst thing in the world, but it’s not a lot better than, say, using Notepad on Windows. At least Notepad lets you use the tab key. And when you have to move a design from site to site, you have to recreate each template page and snippet (reusable snippets of template code are known as “forms” in TXP parlance) one by one.

However, I’m not here to critique TXP’s minor functional limitations. Instead I want to share a small but fairly advanced trick I discovered as I was trying to think of a way to move a fully working and complete design from a TXP install on my localhost up to the install on my production server. And it’s here that TXP’s database-centric template system becomes a significant advantage.

All TXP template pages are stored in a database table called “txp_page”. All TXP forms are stored in a database table called “txp_form”. So potentially, all you need to do to initiate an updated design on a TXP site is to over-write each of those tables in your production MySQL database with two exported tables from your local database.

Easier said than done, right?

Well, unless you’re really comfortable with command line MySQL, you’ll need, at minimum, a working version of PHPMyadmin on your server and some kind of database tool on your development machine. I use Sequel Pro, which makes finding and then exporting the requisite database tables as a “.sql” file very easy. Remember, you have to export each table separately for this to work.

As an aside, a real MySQL pro could probably tell me a much faster way to do what I’m describing. And I hope they do! But I’ve tried this method and it works a charm.

Important note: It should go without saying that you really have to back-up both your local and production database before you attempt this trick. I once lost several weeks worth of posts when I ran a database operation that I shouldn’t have. Though in my defence, it was a dodgy TXP database plugin that I was using AND I thought I was hitting the “run backup button”. Always double-check every action when you’re messing with databases.

So, once you’re in PHPMyadmin, select the first database table you need to update. Choose “import”, select the .SQL file on your local machine, then hit “go”. Once that’s merged into the database, choose the next table, import again, and, whammo-bammo. You’ve got a whole new Textpattern template live, without having to cut and paste into a single textarea. Pretty neat, huh?

Posting Interface Size

Posted Sep 09, 2009 in Technology Comments 2

Nice post comparing the interfaces of a number of blogging tools. Adam Mathes compares Movable Type, Blogger, and Wordpress and finds that they all come up short compared to Twitter:

This is why anyone – even confused celebrities who barely comprehend technology – can actually use this product. You show up, there’s a box at the top, you type in it, and it shows up below with other people’s stuff you can read.

Textpattern’s posting interface has a bit more complexity, but it does one thing right. On logging in, you’re always presented with a big box for typing in and a prominent “Publish” button.

(Yes, I am on a bit of a Textpattern kick again, why did you ask!)

update: Post discovered via the inestimable Waxy Links.

Textpattern 4.2.0 Released

Posted Sep 08, 2009 in Technology Comments 0

Most beloved of CMS tools, the mighty Textpattern, is now version 4.2.0.

Check out the release notes.

HTML5

Posted Jul 07, 2009 in Web Design Comments 0

It’s clearly well past time that web developers started to pay real attention to HTML5, the forthcoming new HTML specification. I’ve been keeping half an eye on its progress for a couple of years, alternating between hope and fear. Hope, from the promise of better semantics (header and footer container elements), fear, from the apparent dropping of alt attributes.

Simon Willison has being doing good work highlighting new technical developments and raging arguments about the new standard.

App Store Reviewers Suck

Posted Apr 22, 2009 in Technology Comments 0

Via Daring Fireball, a pretty depressing tale from Garrett Murray, developer of a stats app for the iPhone.

Irsquo;m far more likely to get 15 one-star reviews when something goes wrong than I am to get 15 five-star reviews when everything goes right. Perhaps itrsquo;s just frustration speaking here, but when Apple ties my hands behind my back and lets users punch me publicly in the face without allowing me to at least respond back, itrsquo;s hard to get excited about building an app.

I sympathise, but I have to wonder how much actual attention most people pay to reviews on the App Store. The average buyer must have figured out by now that most reviews are written by homophobic twelve-year-olds on sugar highs and adjust their expectations accordingly. Furthermore, I guess one upside of the current pricing model is that it’s easier to take a risk on the app if it takes your fancy, despite clearly negative reviews.