Drupal and Quanta: A Winning Combination

| | | |

Any of you who subscribe to this blog's RSS feed will notice that there haven't been any new posts in a while. The reason is simple, and no doubt obvious when you look at the site that surrounds these words. I've been working on the new design since I realized that I could either add a lot of the features I wanted to manually, or I could switch to a Content Management System (CMS). When I first started Linux App Finder I didn't even know that CMS's even existed, but one of the benefits to creating a database of Linux applications is that I find some really interesting ones that I want to try out.

The original site design consisted entirely of custom HTML and PHP code written in Quanta. It worked well for a while, but I started to get frustrated about how much time it was taking to make a blog entry, post some news about the site, or add features like a site-wide login. I resisted the move at first because it would be a significant effort and I didn't want to rewrite everything that didn't fit in with the structure of what I already had. Fortunately I had run across Drupal in a few articles and had seen a lot of sites I liked that used it. After reading through their website a bit, I decided to give it a try. Before I continue I should state that I picked Drupal because what I saw of it appealed to me and it felt right. I never tried any of the alternatives so I can't give a direct comparison.

Initial setup was a breeze. I simply downloaded and copied the files to my server in a test directory, editing the settings to point it to my MySQL database, and followed the installation handbook on Drupal's website. There is a great screencast showing an installation which made the entire process more enjoyable.

If I had been starting from scratch using Drupal, everything would have been a snap, but since I was converting an existing site, it turned out to be fairly complicated. Even so, Drupal provided the tools and flexibility that I needed. My main challenges were rebuilding the category and package pages. I have two category and one package page that are used to generate the majority of Linux App Finder's content, and they don't fit in well with the default site layout. The previous site used variables passed in the URL to determine the appropriate category or app, but I wanted to change that and organize with more easily to read URLs, while still allowing the existing ones to work.

Drupal comes with a default page.tpl.php file that needed to modified to accomplish what I wanted. I found a nifty how-to on the forums that showed how to created multiple versions and choose the correct one based on the URL. Problem solved. Now I was able to use the existing files and just plug them into a new page and then use a capability in Drupal for URL aliases to convert the old links.

You might have noticed that I also mentioned Quanta in the title of this post, but have barely mentioned it. Here's how Quanta contributes as a tool for the new design. Drupal allows you to enter PHP code directly into a page, but my problem was that any code shared between pages would have to be updated multiple times, and I would always have to login in to Drupal to do it. I preferred continuing to use Quanta so I decided to use include statements to point to a separate file. This resulted in the flexibility I desired. I could now edit pages in a more user friendly and powerful environment and then do a quick upload to update the website. Quanta is my HTML/PHP of choice, but this method could also be used with another development environment. It offers benefits such as a tabbed environment for separate pages; universal find and replace; documentation for PHP, CSS, and more; code helpers; and FTP access to upload only files that have changed.

Other than the custom sections that I had to create, morphing the rest of the design was pretty straightforward. I started with the default bluemarine theme and added or modified the style.css file to meet my needs. With the multitude of themes available for Drupal, finding one that fits the general format of your design and modifying it makes quick work of the task.

News and blog entries are the next areas I focused on. Creating these sections couldn't be much simpler. It was very easy to start a blog by creating the first entry, giving it a custom URL, previewing and then posting it. You can choose whether to promote it to the front page or just keep it in the blog. A RSS feed is automatically generated so there's no extra coding required. Posting news or articles is a similar process.

Forums were my next challenge. The previous site used phpbb, which I liked, but felt it would be better to switch to Drupal's forums for a more consistent interface and easier use of the same logins. I was prepared for a lot of work, but after a check of the Drupal website I discovered that someone had already done the work for me. They had a great module to help with the conversion. I had problem with the bbcode piece, so I ultimately disabled that and everything went smoothly after that. The forums is the only place of the old site wherre I did not get the existing links forwarded, but I'm not too worried about that since there weren't very many posts yet.

The final feature I'll mention today is blocks. Blocks are individual sections of code that can be easily arrange in your page. Every block is assigned a weight and section (header, footer, left sidebar, right sidebar, or content). The weight determines the order of the blocks in the section. If I wanted to switch the login from the top of the left sidebar to the right all I would need to do is choose right sidebar from a dropdown box and save the new settings. You also have the ability to control which page each block appears on. For example, you can set it to only appear on the front page by using , or only on the blog by using blog/*. Control can also be reversed to show the block on every page except the ones you designate. And if you want to get really fancy you can have PHP code in your page determine if a particular block is shown.

After having completed the transition to Drupal and still being able to manage my code with Quanta, I am very happy with my choice of a content management system. If you are looking from some great web development tools, I strongly recommend them both.

Post new comment

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
More information about formatting options