26 July 2010
Basic working knowledge of Dreamweaver, web standards (XHTML, CSS), and PHP.
Content management systems (CMSs) are nothing new on the web. These systems are supposed to help users create, structure, and automate publishing content. Today, every company is looking to save costs and seems to be shifting attention back to the web (and hopefully to customers). The web is seeing another call to arms on all fronts from basic users to designers and developers. This time people are looking for good, flexible, free content management systems to run their web site.
One of the most popular content management systems available today is Drupal. Programmed in PHP, this powerful software comes from a large open source community who works together on the core. From large social entertainment portals to small local business sites, Drupal is deployed by beginners and professionals for many projects. Sites built on Drupal are notorious for powering social web features such as the Adobe Flex Showcase site, a noteworthy use of Drupal with Flex. The beauty of Drupal is that it does the heavy lifting for you while it adheres to web standards and easily offers social multimedia publishing. This article covers Drupal 6, released in early 2008.
With its core, Drupal allows web professionals to set up a site where all the content is editable and flexible. Adding pages and navigation links is really easy see Step 4 of this article). Secondary content, sometimes known as side content, is painless to arrange (covered in Step 5).
Read on to see how you can set up a Drupal site in just 10 steps. Learn about adding content, altering menus, modules, and themes, and how to get your site ready for search engines and users.
To begin, download Drupal:
Do not alter any of the Drupal folders and files except for the contents of the sites folder (which lets you store your modules and themes). Altering core files affects updates and maintenance, not to mention your sanity when things go wrong.
You'll see two subfolders: all and default. The all folder lets you share modules and themes across more than one Drupal site. The default folder is where Drupal retains your site settings and its files. A powerful feature of Drupal is the ability to run multiple websites from the same core files, known as Drupal Multi-sites. This article steps you through setting up a single Drupal 6 site.
Drupal, like all software, has minimum requirements to run properly. Make sure your web server is running the following:
Note: For details on how to set up a PHP server, refer to Setting up a PHP development environment for Dreamweaver.
When your system meets all requirements, you are ready to install Drupal:
The .htaccess file is required to enable clean URLs on your website.
Note: If you visit the install.php page and receive an error, or don't see anything on the page, then copy the files to your web server again and check your web server setup.
When you arrive at the default screen of a fresh Drupal site, you see some instructions regarding your next steps but you can ignore that text if you wish and continue to Step 2 in this article.
Note: If you prefer editing config files as opposed to an install wizard, then edit settings.php before running install.php. This will skip the database step of the install.
Drupal is a big project in terms of the number of people contributing to its core and modules. Some modules are simple, such as adding bookmark links on pages, or that nice administration menu I mentioned earlier. If you were to take two minutes to read about every module available, it would take you more than a week to go through the entire list. Of course you would never install every module available—your site would slow down if not crash if you were not careful. Remember, your server is processing content through every module in some fashion. There are tons of modules for all your site needs and it is common to hear Drupal community members respond to questions with, "there (probably) is a module for that."
By default, Drupal 6 does not turn on every module in its core. Features such as Blogs, file uploading, and custom clean URL paths rely on their modules being turned in the Administer > Modules area (see Figure 3).
Before downloading any new modules you should enable some optional Core modules. Enable any of the following core modules that appear beneficial for your site:
To enable a module, visit the Modules administration page and select the check box next to the module name you want turned on, and then click Save. Feel free to review the other core modules I did not mention.
With great power comes user permissions. Modules have their own set of configurations and user permissions (see Figure 4). You must visit the Permissions administration page after enabling any new modules on your site (Administer > Permissions). I cover users and roles in Step 7.
Remember: Modules you download or create should only be installed in your sites folder, for example sites/all/modules.
Knowing what modules are safe to use can be a tough call. Core modules that ship with Drupal are safe whereas any module you introduce beyond that adds not just features but overhead. Each module uses additional server resources such as CPU, memory, and possibly storage. Video and file costs are usually at the top of the chain. To validate a module that is good enough to use requires a little investigating, as well as testing. Each community module page on drupal.org provides links to bug reports and support requests. I advise you to take a peek in each of those areas to get an idea of how active the module support is. The goal is to make sure a module matches a desirable standard and won't conflict with something you may have already installed.
The following list summarizes some free modules that I like to use:
Acquia, started by the creator of Drupal, spent time and money on assembling a release of Drupal that ships with popular modules. All the modules listed in the Acquia release are available separately for download on drupal.org. Companies looking for a Drupal support channel besides community forums see a download such as Acquia Drupal as a safer bet than grabbing random modules. Microsoft even offers the Acquia Drupal package for download to Windows customers.
Drupal controls the look of your site with a theme, which is usually just a folder full of nice templates, CSS files, and images. You typically choose a site theme to be your front end. A theme controls the display by assembling all the theme parts (templates) while building each page; almost in a sever-side include fashion. Drupal comes with a handful of themes, most of which looked cool a few years ago. Luckily, Drupal allows new themes to be installed. You can create or download a new theme that will change the look of your site entirely and instantly restyle your content.
You get what you pay for. I am not joking. I've seen free, cheap, moderate, and expensive theme costs. The free themes on drupal.org are mostly decent and if one of those themes works for you, then use it until you get sick of it and then look up a new theme. Swapping themes is like changing clothes, you just put the new style on. Don't expect free themes to be advanced (that is offer a lot of flexibility beyond a 3-column layout with header and footer). A good example of some advanced themes anyone can try out are Acquia Slate and Acquia Marina (used by SpreadFirefox.com), released by Top Notch Themes (in partnership with Acquia). The team at Top Notch Themes produces highly flexible, advanced themes that fit everyone's budget.
Some themes have support for the Color module, which would enable multiple color variations within a single theme. You can change the colors of the default Garland theme in Drupal 6 by choosing Administer > Themes and clicking the Configure link for Garland. You will see a color wheel and a list of color presets (see Figure 5). Choose a preset or your own colors and click Submit to save your new theme colors.
If you are used to adding pages and sections of content to a site by adding folders and HTML files then you are in for a treat. Drupal does not need pages uploaded to add content. To add pages in Drupal, you just paste the page content into a form that saves the content in the site database. You can save plain text or full HTML content. Luckily, no programming or database knowledge is required to add content to a Drupal site.
Websites are about web pages and that's why Drupal provides this feature by default, so add some common pages. For new sites, I like to add pages such as Contact Us and About Us first. Follow these steps to add pages in Drupal:
You just learned how to add a new page in a Drupal site. If you added values in the Menu fields of the create content form then you should see the link to your new page in a menu near the top.
Most site content will be page nodes, a Drupal term used to describe saved content. If all you create are Page nodes for a site, that's fine (that is what they are there for). Nodes can be any piece of saved content, not just page types. Story and Blog posts are also nodes. When you add a Video module, for example, you would see a Video node type added to your site. To create your own node type (for example, Press Releases or News ), go to Content > Content Types > Add Content Type.
Blocks are not nodes but do contain content, usually secondary content. A Drupal theme has defined areas on its page template known as Regions where the Blocks appear. Blocks are usually positioned in sidebar regions, however, you can add a Block to the header, content, or footer regions if you want. The more Regions a theme has, the more flexibility there is with Block positioning.
Drupal ships with a dozen or so blocks, including Who's New, Who's Online, Search, and one of my favorites, Syndicate, which adds an RSS icon in any region I like. Modules even add new blocks where necessary, and you can add custom HTML/PHP blocks with a simple form. Most blocks are disabled by default, and there is no limit to how many blocks you can have on a site (enabled or disabled), but administering a long list of blocks may slow down the Blocks administration page and affect site performance.
To help fill up a site adding blocks is a good move. When you add external RSS feeds to Drupal, each feed generates a new block just begging to be placed in some region. Go to the Administer > Blocks page to choose which blocks will appear on your site (see Figure 7).
Just like themes and modules, each block has its own configuration settings available, just click the Configure link next to the right of each block name. You can override the default block title and configure it to appear on all pages or just some. For example, the Powered by Drupal block offers color and size options.
Navigation in the Drupal world is controlled by its Menu layer. Menus are lists of links that can have a hierarchy. By default every Drupal site has three menus: a Primary menu, Secondary menu, and Navigation menu. The Navigation menu is populated by default and has links that usually appear for logged-in users by default. Primary and Secondary menus are used for top-level navigation (such as main pages or site sections). You can even create menus from scratch. Any menu can be turned off or on and have an altered appearance. The power of Drupal is not just administering the order of menu items but fully respecting user permissions. For example, if a user doesn't have access to a page, then Drupal will not add the link that exposes that page.
A long-time feature of Drupal has been its dedication to using web standards markup, such as the use of lists for menus and navigation. Proper use of
<ol> list tags was one of reasons I began to like Drupal years ago. I felt it build sites similar to me doing so by hand, only quicker. The Drupal community has a large number of web standard advocates and it is uncommon to see non-XHTML markup in your pages. Knowing Drupal builds menus the way I would by hand leaves me to worry only about the type of links I want and what styles I'll render them with.
One major difference a CMS brings is the ability to control not just content but users in a similar manner. Your site can allow anyone to register as a user, which is on by default, or you can lock people out from public registration and personally accept every user that signs up. These options are listed under Administer > User Settings. You can also edit any e-mail template the system will generate for users; everything from forgot password messages to a welcome e-mail.
Administering users individually is not an ideal way to run a site; instead you would want to administer broad groups of users, known as roles. By default, Drupal comes with two user roles: Anonymous and Authorized. Both roles are locked, which means you cannot delete them. Anonymous users are general visitors who are not logged in. Authorized users are site members who are logged in. You can come up with your own custom roles and assign custom permissions to any role. Custom roles cannot affect anonymous users, only authenticated members. Some people create roles named staff or moderators. To assign a role to users edit any account under Administer > Users and choose each role they need.
Each module and feature in a Drupal site has a set of permissions that needs to be tied to roles. Every module you enable should have at least one permission check box on the Administer > Permissions page. This page is where you will choose permissions per user role, so it is best to come to this page when you have completed adding roles and installing your modules, so you can set the permissions up in one move. Set some permissions for both anonymous and authenticated users, plus any role (or roles) you added.
As the site administrator (user #1) you have permission to everything already, and do not grant permissions to everything on the site to just any role. Be sure to think about what you are activating and for who.
Learning how to optimize your site for search engines takes a lot of reading, planning, testing, and reporting, and the process never ends. When it comes to SEO, you need to start with the basics: Content markup should always use <h1>, <h2>, and <h3> tags for headings and <p> tags for body text; Drupal can help with these through Input Filters mentioned before.
Standard elements you need in place to do some real SEO tilling include meta tags, site maps, and clean URLs. The list of modules and next steps are thankfully packaged in a community module known as the SEO Checklist module. This helper module provides a list of tasks, modules, and services that help your site get spidered well. Not every task is required, but you should complete a majority of the tasks recommended by the module, especially adding meta tags and installing the XML Sitemap module.
The internal page cache feature of Drupal 6 is decent for most sites to start with. Drupal broadcasts stored compressed cached pages to anonymous users, resulting in faster internal page assembly. Essentially, Drupal would not have to rebuild a page each time it is viewed until the cache reloads. This useful feature is on the Administer > Performance page. To activate it: click the Normal radio button and choose at least 1 minute under the minimum cache lifetime. I recommend enabling the Page and Block cache options as well.
Now that Drupal can internally cache pages you will see processing of requests faster for new users, but you continue optimizing by compressing all the external styles and script files that load for each module. Each module adds a new
<link> tag for its CSS in your
You can enable CSS and JS compression in the Bandwidth Optimizations area of the Performance page. Pages really load fast when this setting is turned on, but be warned: if you're changing a theme file and leave this feature on, your changes will not appear until the cache clears on its own or you click the Clear cached data button at the bottom of the Performance administration page.
This step is necessary to maintain the success of running your Drupal site. Two things you need to do now are update site content and back up your site! Don't risk loosing all your work only because you forgot to back up—automate backups and content updating. You can have the site update its content and feeds, submit updated site maps, flush old caches, and back up the entire database without you needing to be there.
Out of the box your Drupal site cannot update itself without your help, or help from someone else; how about a robot? Your web server is a robot you can program to run what are known as cron jobs or cron tasks, which are scripts that run at certain intervals. Drupal needs a cron setup (pointing to cron.php every hour or so). This allows Drupal to run any automation tasks you set up, such as backups, updating RSS feed or blocks, and indexing new content properly.
Read the official Drupal handbook page on cron.php and cron tasks. If your server does not allow you to add cron tasks, then I recommend a module called Poormanscron that will work fine for getting started.
Backing up is a necessary task for every site. You should back up before updating modules, updating Drupal, or even before adding any new modules to your site. This is an easy precaution to take. There will be a time you will need to update your site modules or core. The Drupal handbooks offer detailed instructions on how to perform an update to your site and modules, so I ask you read those details while I offer a quick, painless way of backing up that is cost effective and takes just one click.
All hail the Backup and Migrate module for Drupal! This module does a lot of tasks in just one click by backing up your Drupal database properly and compressing the backup into a tiny file that you can download or save in a files directory on your site. You can even automate the backups.
This concludes the first article in my series covering Drupal 6. By now you should be familiar with the various Drupal terms and administration areas of your Drupal site. Your work doesn't stop here. The responsibility of a CMS is that you need to use it. In fact, records have shown that migrating to a CMS slows during the adoption phase, which is when people are supposed to be using the system. Basically people are hesitant to learn a new system or are not properly trained. Do not let that happen to you or your company.
In my next Drupal article, Working with Drupal in Dreamweaver CS5 (coming soon), I will be covering themes and what designers need to know to assemble their own.