Textpattern: Step 1 - Install

I am planning to give step-by-step instructions on developing a website using Textpattern as the content management system, using this site as the example. I know how useful it would have been to have something like this when I first started building sites.

Requirements

I have already installed Textpattern, as you can see, but for those who are new to the process. Here it is step-by-step. But before I get into it, here is what you will need:

  1. A web server. It can be a local host on your own computer, especially if you have a Mac running OS X, my personal preference. It comes installed with your own Apache Web Server. Turn it on in System Preferences > Sharing > Personal Web Sharing. Look for resources on setting up your localhost as a testing environment. Alternatively, you can use your favourite web host, for example, TextDrive.
  2. PHP and MySQL installed on your server. PHP is a popular open source programming language for web applications. The MySQL database server is the “world’s most popular open source database.” SQL is short for Structured Query Language. I have found Marc Liyanage’s Mac OS X packages and instructions to be quite helpful.
  3. MySQL Administration Application to create and backup your MySQL database. Many web hosts provide access to databases through phpMyAdmin. For Mac OS X users, there is a nice GUI application that will do many of the same things called CocoaMySQL or use MySQL’s very own MySQL Administrator.
  4. FTP Client to upload files to your server if you are using a remote host. I especially like Transmit from Panic.
  5. A web browser. Obviously, but preferably a standards-compliant browser such as Safari or FireFox.
  6. A Text Editor such as BBEdit, StyleMaster, Dreamweaver or other coding application for creating your XHTML pages and CSS files. This isn’t necessary, since you can do all this in Textpattern. But I find it helpful to develop outside of Textpattern, then paste my finished XHTML and CSS code into Textpattern when I’m happy with it. TextWrangler from BareBones has become my new friend. I can now edit /etc/hosts and /etc/http/httpd.conf files from TextWrangler because it supports saving as root user when logged in to OS X as any other user, given you know the adminstrator’s password. But that is about local hosting, a whole other topic.

Installation

Now that you have everything that you need, let’s move on to installing Textpattern:

  1. Download Textpattern.
  2. Create your database.
  3. Install Textpattern by uploading files to your web server with an FTP application, following the instructions to connect to the database by modifying the configuration file config.php (rename the file config.php.default and replace the code with the code produced by the setup page). Completing this configuration process will automatically populate the database with tables ready for your first post.
  4. Set Up by logging into the Textpattern Administration area. For more detailed instructions on setting up Textpattern, check out TextBook.

Building a Site with Textpattern

This is a basic overview of the process of building a Textpattern site:

  1. Layout the basic page (create a file called index.html) using standards-compliant XHTML. You can make tag soup with Textpattern, but why would you want to? To learn about how to create semantically correct XHTML code, you can download (purchase issue 3 for USD $3) a nice little magazine called Design In-flight (sadly, soon to be out of print). Other links are listed below:
  2. Develop the CSS file as an externally linked file. Some people like to continue using an externally linked CSS file with Textpattern as it can be faster than having an extra query to the database. What I like to do is create a “css” directory in the root directory of the server. Then I can create a file called “styles.css” in the css directory. For help with developing your CSS file, you can’t find a better guide than the the tutorial at westciv.com. Why use Cascading Style Sheets and XHTML? These are the people and the sites that started the revolution (for myself, at least):
  3. Modify the structure of your content by pasting your XHTML code into the default page (this is your home page). To generate dynamic content, use the appropriate Textpattern tags. Here’s where the power of Textpattern comes into play: in the combination of textpattern tags and forms. The display of articles is controlled by article forms. The display of lists are controlled by list forms. Commonly used code can be saved as misc forms so that the code can be reused easily on several page templates. You can then modify one form to make changes to the same code used on multiple pages. I could theoretically see a site built using only the forms to manage a hard coded pages.
  4. Change the look of your site by pasting your CSS into the default style. This is what sold me on the idea of using Textpattern as a content management system (CMS): the overt separation of structure (content) and presentation (style). It was the first CMS I found that made me think, These people get it. The other great thing about Textpattern is the community of people involved in creating, using and developing the application. Join the online forum and stay tuned for the first Textpattern template contest presently under way. View the results at the TextGarden. And I’m sure a book will soon follow. If there are no plans for a book, there should be, and I would be happy to offer my services.

Step 2 will guide you through the process of building an actual site. As a quick aside, there is also Step 1.1, in case you might like to try modifying the name of the directory which will become your administration area.

comments | date posted posted Thursday July 7, 2005

The Builders Collective

The Builders Collective is about building community and building a repository of ideas, techniques and code for building a better world wide web.

Articles Archive > View Recent