A Rapid Drupal Site Recipe

On November 1st my wife and I launched TraumaAdoption.org as a way to support the foster and adoptive community--particularly those who have adopted or foster kids from tough circumstances. We decided to build the site rapidly in Drupal using Core, Contributed Modules, and a Contributed Theme. It took less than two weeks in our spare time.

After completing the site, it seemed like it would be good to write a series of posts on the basics behind how we did it.

A Recipe for a Rapid Drupal Site--Part I, Gathering Your Resources

Trauma Adoption Screen Shot Building a Drupal site can be done very quickly and inexpensively under the right circumstances. You need no programming or CSS skills and limited skills using FTP as long as you are willing to make compromises. Yesterday, my wife and I launched Trauma Adoption after about a week of effort in the evenings. There is still more to do on the site, but it was very quick to put together. First, some assumptions.

  1. We will use a contributed Drupal theme
  2. We will use only contributed Drupal modules
  3. The extent of "custom" work will extend to using CCK and Views
  4. We will live with what Drupal outputs out of the box

The steps...

A) Obtain a domain and secure hosting. There are quite a few options for domain registration ranging from GoDaddy to Network Solutions. As for hosting, there are lots of options in this realm as well. Personally I use Brownrice Internet but there are lots of other options ranging from dirt cheap to very expensive. In this recipe, all you need is FTP access.

B) Sketch out what you want the site to do and the main areas that people will go to. For example, in TraumaAdoption we knew that we wanted:

  1. Blogs - only specially chosen bloggers should be able to create blog posts, but anybody can read them
  2. Forums - ANY registered user should be able to post to the forums
  3. Books - We wanted everybody to be able to see book reviews on the site, but only special reviewers to be able to post reviews. Ultimately we want an easy way to post Amazon.com content on the site.
  4. Offsite Resources -- Anybody can view offsite resources, but only administrators and moderators can add content to the offsite resources.
  5. Events - We wanted a simple event calendar to add events to. Only administrators and moderators should be able to add an event. Everybody should be able to see events.
  6. Comments - Anybody (including anonymous users) should be able to leave comments. However, we want to using some kind of screen to prevent abuse.
  7. Social Bookmarking - We wanted to allow for social book marking

What we have here is user roles/experience at the most basic level. In developing client sites at pingVision this process is much more comprehensive but the idea is the same. Figure out who can do what and where.

C) Gather your resources!

  1. Drupal 6.x
  2. From the Modules section on Drupal.org:

  3. Adsense
  4. Advanced Help
  5. CCK
  6. Checkbox Validate
  7. Devel
  8. Event
  9. Fivestar
  10. Legal
  11. Link
  12. Mollom (from Mollom.com)
  13. nodewords
  14. Pathauto
  15. Service Links
  16. Token
  17. Views
  18. Voting API
  19. xmlsitemap

Get yourself a contributed theme from Drupal.org's Theme Repository. You may want to download several and enable each of them to see what you think.

D) Setup MAMP, LAMP, or WAMP depending on what platform you're local computer is so you can work locally. You can follow the instructions that I set up for a local install on a Mac. Those instructions are for Drupal 5.x, but they will work fine for Drupal 6.x as well.

Once you have your local install ready...it is time to start constructing. The next installment of this series will involve basic configuration of your Drupal installation to get down to building.

A Recipe for a Rapid Drupal Site--Part II, Blocking Your Site Out

Now that you have all your resources together and you have an instance of Drupal running, it is time to load up your your modules and your themes.

A) Set up your instance Go to your /sites/all directory. Create a modules and themes directory in /sites/all. Put the contrib modules into the modules folder and the themes that you downloaded into the themes folder.

B) Fire up *AMP and pop over to /admin/build/block to see what regions you have to work with. Regions are areas where blocks can be placed from the block menu.wireframeregion

Blocks are areas that you can display information. They can be lists of nodes, advertisements, snippets of HTML, snippets from sites like flickr or twitter. Once you know where your regions are, you can start sketching out what you want to go where within the general layout. This basically the wire framing process.  

When engaging in wire framing at work we start from the idea that anything can go anywhere on any page. When using a contributed theme that you don't modify, you are going about the process a bit backwards. You need to map out where you want your elements to live limited by what the module contributor has built for you to work with.

C) I generally enable a mess of modules at this point.  Go to /admin/build/modules

  1. CCK (Content, Content Copy, Fieldgroup, Link, Number, Option Widgets, Text, and User Reference)
  2. Blog
  3. Book
  4. Color (if the theme you have chosen supports the Color module)
  5. Comment
  6. Contact
  7. Database logging
  8. Forum
  9. Help
  10. Menu
  11. Path
  12. Profile
  13. Search
  14. Statistics
  15. Taxonomy
  16. Tracker
  17. Update Status
  18. Upload
  19. Event
  20. Advanced help
  21. Checkbox Validate
  22. Meta tags
  23. Service Links
  24. Token
  25. Views
  26. Views Exporter
  27. Views UI
  28. Voting API

After these are enabled I go back and enable

  1. Legal
  2. Pathauto
  3. Fivestar

D)  Now we can start to place the blocks that you want to use on the site.  We haven't enabled Adsense yet--we'll get to that later, so you'll want to create place holders.   Some blocks are generated by  modules.  Other blocks are created by the site administrator.  blocksCreating basic blocks is very easy.

  1. Go to /admin/build/block and click on "Add Block"
  2. Fill out the form

You might want to do a few as place holders for ads. 

In the case of TraumaAdoption.org I also created two bulleted lists using HTML -- one with ten items for Offsite Links and one with five items for Books.  Each of these will ultimately be replaced with a view.  More on that later.

On /admin/build/block you can start to drag and drop your blocks to the places you'd like them to live.  Each of the regions will be labeled.  Disabled blocks are at the bottom menu.  Remember to click "Save Blocks" at the bottom of the screen or your changes won't take.

Now your site is basically blocked out.  The next installment will review building basic content types.

A Recipe for a Rapid Drupal Site--Part III, Setting Up Content Types

The next step in setting up your site, is to create content types over and above any "out of the box" content types like blogs, pages, and forums. On TraumaAdoption we created:

  1. Book Reviews
  2. Offsite Resources
  3. Public Adoption Services

as custom content types using Content Construction Kit (CCK). The process is of creating a new content type is quite simple.

Content Type

  1. Document what fields you are going to want to collect. In the case of the Public Adoption Services type I needed:
    • Title
    • Body
    • Address 1
    • Address 2
    • City
    • State/Province
    • ZIP/Post Code
    • Phone
    • URL
  2. Go to: /admin/content/types and click on the "Add Content Type" tab
  3. Give your content type a name, type, and description
  4. If you un-collapse "Submission form settings" you'll see that you can change the Title and Body titles and you don't need to create those fields in building your content type.
  5. Set your comment settings
  6. Under workflow settings you can decide if you want your content to publish to the front page, if it defaults to be published, if it will be sticky, and if you are going to create a new revision.
  7. Click on Save content type
  8. Back on the content type overview page, click on "manage fields" on your new content type.
  9. Add fields that match the fields you need.  In TraumaAdoption's case, that meant adding Address fields, City, State/Province, ZIP/Post Code, Phone and URL.  Make sure that you select a field type and widget that fits your field's needs (select box, radio button, text field and so forth).
  10. Click "Save" at the bottom of the page.

You now how your new content type.  Repeat this process for each content type you need.

The next installment will cover creating Views for your content types to create pages and menu items for those pages.  Views can also create blocks, so we'll look at how to make blocks and place them where your placeholders exist right now.

A Recipe for a Rapid Drupal Site--Part IV, A REALLY Basic Introduction to Views

After you have your content types set up, you can use Views to create custom pages and blocks.  In the case of TraumaAdoption.org we created a couple of pages and a few blocks with lists and pagers at the bottom.  This post won't cover more than just the basics of using Views.  Greg Knaddison did a great screencast on using Views.

The current version of Views has a pretty steep learning curve, but once you've learned the basics the amount of power to control outputs without being a developer is pretty significant.

views

We'll walk through the steps to create a simple page and a block with node titles.

The Steps...(Save OFTEN while going through these steps)

  1. Go to /admin/build/views.
  2. Click on the "Add" Tab.
  3. Give your View a name, a description, and a tag.  For the purpose of this example, leave the "node" radio button selected.
  4. Click "Next".
  5. At this point you are looking at the default view.  You can set some global options here for your set of Views.
  6. Give the default View a Name--Something like "Default Book Review"--that describes what you want this View to do.
  7. Give it a Title
  8. Click on "Use Pager" and choose "Full Pager" and click "Update"
  9. Click on the + beside "Fields".  You can filter your choices with the pulldown below "Add Fields".  Choose "Node" and then select "Body", "Post Date" and click "Add" and click update in the same box below for each field.  Repeat for "Node" "Title". If you click on the "exclude from display" it will cause the field not to be part of your page view.  You can also choose to move the fields around using the arrow icon and then drag and drop in the window below.
  10. Go through the same steps for different kinds of fields like the User name.
  11. Now we need to filter the results.  We'll create a very simple filter.  Click the plus beside "Filters".
  12. Check off  "Node Type".
  13. Click "Add".
  14. Choose the Node Type you want to filter by.
  15. Click the plus beside "Filters".
  16. Choose "Node" and "Published".
  17. Click "Add" and check the "Published" box.
  18. Click "Update".
  19. Click "Save".

If at this point you click on Analyze, it will indicate that you've done everything that you need to do for the default View, but that you don't have a page or a block yet.

The default view will work great for a page.  Up top on the left, leave the pulldown on "page" and click "Add Display".

  1. Go through the same steps of changing the name and title--but reflect that this is the "Page" version of your view.
  2. In "Page Settings" add a path name--that is where the page view will show up on your site.
  3. If you want your page view be included in your menu, Click on "Menu" and choose the radio button for the menu type you want to include.
  4. Click "Update" and "Save".

You now have a simple page view set up.

Now lets create a block. Up top on the left, change the pulldown to "block" and click on "Add Display".

  1. Go through the same steps of changing the name and title--but reflect that this is the "Block" version of your view.
  2. I want to only have the title show up and I want it to be linked.  Click on "Node: Title" in "Fields".  Click on "Link this field to its node".  Click "Update".
  3. Click on each of the other fields and click on "Exclude from Display". Click "Update".
  4. Click "Save".

Your Block Menu /admin/build/block should now have your new block.  If you drag it to a region and update it, it should show up in that region.

When you are creating your block or page you will sometimes be given the option to override or modify the default view.  If you want to leave the default view alone to work from, use overrides.

Thanks to Merlin of Chaos for developing and sharing Views.

The next post in this series will cover all sorts of small sundries to start buttoning up site details.

A Recipe for a Rapid Drupal Site--Part V, Buttoning things up

So far we have gathered our resources, blocked out the site, set up content types, and created some simple views to display that content. In this post, we'll look at:

Targeting a Landing Page

Unless your site is purely a blogging site, you probably will want to target something other than Drupal's river of news. Any page on your Drupal site can become that default landing page. You can create a page using the page content type that has any kind of introductory text--perhaps embed a photo. After you have created the page that you want to target, go to: /admin/settings/site-information and scroll to the bottom. Replace "node" with the page that you want to target. While on this page, you could update your site's name, mission, and so forth.

Setting Up a Google Ad

Setting Up Some Basic User Types

Terms and Conditions

In the second post we enabled checkbox validate and legal. This automatically gives you a terms and conditions page on the site and it requires that your new users accept those terms and conditions before accessing the site fully.

Remember at this point to head over to /admin/user/permissions and ensure that all the roles are set up to "view terms and conditions".

The next post we'll finish things up!

A Recipe for a Rapid Drupal Site--Part VI, Finishing Up

Last but not least, we're going to look at:

Spam Control
I've been using Mollom a fair bit lately. I think it works quite a lot better than simply using a Captcha. You can get instructions on setting up Mollum in a previous post.

XML Sitemap
An XML sitemap gives search engines a map of what to index. Earlier this year I posted instructions on setting up a sitemap.

Metatagging
The Nodewords Module will help you set up proper metatagging of your content in Drupal.

Pathauto
In the second we enabled Path and Pathauto.

Fivestar Ratings
We've already enabled the voting API and Fivestar.

Service Links
Setting up social bookmarking links is as simple as allowing for basic fivestar ratings. We've already enabled social bookmarking.

At this point we have gone through the process of planning out the site, downloading and enabling both modules and themes, setting up blocks, creating content types, creating views to display content from the content types in on both pages and blocks, setting up a home page, placing a google ad, set up terms and conditions to use the site, enabled some spam control, set up some basic SEO, made our URLs human readable, and allowed for social bookmarking.

The final step is to add content and moving the site to your host!

Drupal Basics -- Dealing With Spam Part II

One of the sites I help manage has been over run with World of Warcraft spam in recent weeks. It has been relatively easy to ban email addresses of offending users, remove the comments, and move on. Add to that, use of Captcha, and the Spam has been kept in check.

I don't want to actively manage spam.

Dries Buytaert (founder of Drupal) and Benjamin Schrauwen created Mollom. It is kind of Captcha on steroids. Mollom monitors the content being posted on your site and allows it through, blocks it, or confronts the user with a Captcha.

Mollom claims (as of today):

Mollom is currently protecting 4187 websites. The average efficiency is 99.72%. This means that only 28 in 10,000 spam messages were not caught. Mollom has caught 7,989,577 spam messages since it started. Today we caught 13,040 spam messages. On average, 76% of all messages are spam.

So, how do you set up Mollom on a Drupal site?

  1. Go to Mollom.com and set up an account
  2. Download the module package (ensure you have the right version for Drupal 5 or 6)
  3. Place the module package onto /sites/all/modules in your Drupal install and unpack it
  4. On the Mollom site, click on "Manage Sites" and choose "Add Subscription"
  5. Choose Mollom Free or Mollom Plus and fill out the form
  6. This will add your site to the Mollom database and provide you with a primary and secondary key
  7. Go back to your Drupal site and go to /admin/build/modules and enable Mollom
  8. Go to /admin/settings/mollom and choose what kinds of content you want to protect

I've set Mollom up on a Drupal 5 and a Drupal 6 site. In the upcoming days, I'll be interested to see how much spam gets caught and how much time it saves me. Hopefully lots!

Drupal Basics -- Metatags

Drupal naturally does well in search engine rankings. There are a few things that you can do to help improve those rankings like using Pathauto, XMLSitemap, and Meta Tags. I've written a little bit about Pathauto and XMLSitemap and now--Meta Tags.

Metatags are less important than they used to be in SEO. They are subject to abuse with most search engines relying on keywords on a page rather than relying on meta-data to determine what a page is all about. That said, adding meta-data to your site can't hurt your rankings and can help.

The Meta Tags module allows you to easily meta tags to your pages potentially improving your search engine rankings.

This module allows you to set some meta tags for each node, view or panels page.

Giving more attention to the important keywords and/or description on some of your nodes allows you to get better search engine positioning (given that you really only provide the keywords which exist in the node body itself, and do not try to lie).

Step 1 -- Install the Module

Step 2 -- Use the Module

Once it is set up, you will find a new fieldset on your /node/add pages called Meta tags. You can enter a few keywords that describe your content and a description field. That field will use your teaser if no description is entered into the field.

Drupal Basics-Improving SEO with a Sitemap

There are two main kinds of search engine optimization (SEO)--Off Page and On Page.  Off Page optimization relies on the links you get from others increasing your page rank.

On Page optimization can include:

Creating a sitemap in Drupal is extraordinarily easy using the XML Sitemap Module.

  1. Download the Module from Drupal.org
  2. Place and unpack it in your /sites/all/modules/ directory
  3. Enable the module at /admin/build/modules.  I would suggest, at a minimum, checking off XML Sitemap, XML Sitemap: Engines and XML Sitemap: Node
  4. From /admin/settings/xmlsitemap/engines you can choose to have the sitemap submitted to search engines upon update, cron job, you can choose to log access, and which search engines you would like to target

Your sitemap will show up at /sitemap.xml

If you want to be proactive with your sitemap, you can submit it to Google using the Webmaster Tools.  From the dashboard add your site to your profile.  After your site has been added, then add your sitemap under Sitemaps -> Overview ->Add Sitemap.  A pulldown will allow you to identify what kind of site you are submitting.  Add sitemap.xml to the text box and click on the Add button.  Google will shortly download your sitemap and will begin processing it.

Sitemaps can be helpful if your site: