For many web developers, the idea of transitioning to a content management system (CMS) is both appealing and frightening. It’s appealing because of how easy it would be to manage once everything is converted. It’s frightening because when you have a large, mostly static site, transitioning to a database-driven CMS requires a lot of work, specifically doing data migration.
Here’s a quick tip on making the transition easier: build a web form that parses static files and allows users to manage content online.
Let me explain. Let’s say you have a static files that call a simple header and footer, so that the source of your typical page looks like this:
<p>Here’s the content. Blah, blah, blah.</p>
<?php include(“_templates/footer.php”); ?>
From this code, it’s very obvious what the user would have access to manage. If your pages follow some sort of pattern (the above one is just an example), you can easily parse the content out of that page. Once you have the content, you can drop that content into a form that allows a user to edit it.
But why do this? For (at least) two reasons:
- Once you have users accustomed to the idea of managing content using an online form, it’s much easier to get them using a standard CMS, such as WordPress, Drupal or Joomla.
- It’s a relatively simply process to tie a parsing script into an existing CMS. The idea would be to make the parser check to see if the requested page content is already in the database. If it is, then it edits the database content. If it’s not, then it parses the page and updates the database. This effectively transfers the work of migrating data to the current content managers.
We’re currently implementing something like this at the business school. If anyone is interested, I’ll post some code and examples.