Journal

27 October 2006

Creating a Theme for Symphony

I have decided to build a theme for Symphony using the Pink for October WordPress theme. I will be describing the process step by step to help others who are wondering about the lack of documentation for developing sites using Symphony. I have found the best way to learn is by playing with the application to see what it can do. Learning about XML, XSLT and XPath are part of the process. Symphony provides a wonderful tool for learning the ins and outs of XSLT templating. So, here goes…

(You’ll notice that changes will be made to this journal entry as I go, so please bear with me as I go through the process.)

I could develop locally, or I could develop live. This depends on which I believe will be faster: my Mac G5 or my TextDrive account. I think I will start locally.

Local Hosting on the Mac

If you want to install Symphony locally, you need Apache installed with MySQL and PHP with the XSLT extension turned on, and the Apache rewrite module active (see Symphony requirements.

Setting up the Virtual Host

As I am working on a Mac, I will head over to Terminal and type the following to update my local hosts file (which I have set up to automatically open these files for editing in TextWrangler. For those who have not done this, replace edit with pico or nano or whatever you prefer as your text editor):

                  sudo edit /etc/hosts

                

To my hosts file, I will add another virtual host so that I can install a fresh install of Symphony. I will use a particular syntax that allows me to view sites locally and avoid interfering with my ability to reach real domains. For this particular Symphony theme, my virtual domain will be located at @http://sym.pinkforoctober.site/@. So, I need to add this host to my hosts file:

                  127.0.0.1       sym.pinkforoctober.site

                

I also need to add the virtual domain to my Apache configuration file. So, I locate my file at:

                  sudo edit /etc/httpd/httpd.conf

                

Then, I add the following at the bottom of the file:

                  NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
    ServerName sym.pinkforoctober.site
    DocumentRoot /Library/WebServer/Documents/sym/pinkforoctober/public
</VirtualHost>

                

While, you’re at it, you can make sure that the rewrite module is active. Do a search for #LoadModule rewritemodule modules/modrewrite.so. Remove the hash mark # at the beginning of the line. So now it should look like LoadModule rewritemodule modules/modrewrite.so. Now the rewriting engine is turned on.

Since these configuration settings are initialized when the server is started up, I will need to restart the apache server. I like to do this by running a command in Terminal:

                  sudo apachectl graceful

                

Creating the Directories

Now, I can go ahead and create the directory for the Symphony installation on my local Apache server according to the path I have set as the document root in the configuration setting above. My path looks like this:

                  /Library/WebServer/Documents/sym/pinkforoctober/public

                

Creating the Database

The next step would be to open up phpMyAdmin and create a MySQL database for the Symphony installation. I will name the database:

                  sym_pinkforoctober

                

Installing Symphony

Now, everything is ready to install Symphony on the server. (As stated previously, it will be necessary to have the proper settings for the local hosting environment, similar to the setup explained by carlos on the Overture Forum Article: Developing locally with XAMPP Lite 1.5.4 for Windows.)

Head over to the “Twentyone Degrees”:http://21degrees.com.au/products/symphony/ website and download the latest Symphony installer by “setting up and account”:http://accounts.symphony21.com/ or logging in if you already registered for an account. Your username and password will be used for the primary administrative user of your Symphony account. For each site that you create with this account, you will login with this user and password. You will then be able to create additional Authors and Administrators.

Once you have downloaded the @install.php@ file, place the file in the root directory of your virtual host. On my server, I will place the file in the following directory:

                  /Library/WebServer/Documents/sym/pinkforoctober/public/install.php

                

In my web browser, I can navigate to the installer on my server at my virtual host:

                  http://sym.pinkforoctober.site/install.php

                

Make sure that the permissions for your root directory are set to 777. Then, simply follow the instructions for the one-step installation procedure and, if all goes well, you should have the application installed in a matter of seconds. When I installed, I chose to “Start with an empty workspace - Best for other themes or building your own workspace.” There will be no front page to navigate to, so I’ll start by logging into Symphony’s administrative interface. Login with your Symphony account username and password.

A journey of a thousand miles begins with one step

If you have made it this far, congratulations! You have installed Symphony and logged in. This is the first step in using Symphony to create websites that take advantage of the power of standards in web design and development.

With Symphony installed, we can now start at the beginning: Building a Symphony Theme: Part 1.