Drupal Site Recipe

File under:

Mon, 15/05/2006 - 4:08pm
willdashwood

As promised here's a very rough guide to how this site was made. Check out the Drupal handbook for much better guides to installation and configuration. Think of this as a reference for those wondering how to create this type of site. It's also for my use as I have a terrible memory and will forget exactly what I did in no time at all.

I'm using Drupal 4.7 final with the additional pathauto and sections modules, keeping it nice and simple.

OK let's start from the beginning. One way or another you need to create a database for Drupal to use. As I don't have shell access on this hosting account I logged in to my hosting control panel (cPanel), created a new database, user and assigned all privileges for that user on the new database. Keep that user name and password safe. You then need to load the database schema. I have remote MySQL access set up for my IP address so I used Navicat MySQL to initialise the database from my own PC. You could use phpMyAdmin just as easily.

The next stage is to upload all the Drupal files via FTP either individually or as the complete archive, decompress it on the server if you have that facility. You will need to edit the site config file located at sites/default/settings.php, inserting your database/user name and password.

You should now have Drupal up and running. Yay, grab a Guinness. What do you mean it's not lunch time yet?

So once you've created yourself an account (the first account automatically becomes the admin account) you can navigate to admin/settings and start with the basics. Site name, email address, footer and clean URLs were the fields I changed from default. One of the greatest features of Drupal is its clean URL system which is excellent for search engine friendliness and logical site structure. If you're running Apache with mod_rewrite be sure to enable it. I think it may also work with lighttpd but haven't tried it personally.

I also set Display of XML feed items to 'Full Text' under RSS feed settings since I don't mind people reading posts entirely in their favourite feed reader rather than having to visit the site.

Now let's choose the modules we want for the site. I've disabled all but the required modules and

  • comment
  • menu
  • page
  • path
  • pathauto
  • search
  • sections
  • story
  • taxonomy

The pathauto module automatically generates paths for each node (page, story, image, etc) based on, in my case, the node title and taxonomy config (see later) but this can be customised.

My use of the sections modules is to specify a different theme for the admin area. When I made my theme I didn't want to fuss around catering for a side menu since that would never be visible to the public. However, when using the admin area it's handy to be able to navigate!

There are lots of other modules I want to use shortly but just to get the site up and running quickly I went for a basic feature set.

From now on I'm going to be a bit lazy and just refer to the options which require attention.

admin/settings/content-types/page

Default options: Published

Default comment setting: Disabled

admin/settings/menu

Menu containing primary links: Primary links

Menu containing secondary links: No Secondary Links

Restrict parent items to: Primary links

admin/settings/pathauto

General settings, Separator: '-'

admin/settings/sections/edit/1

Activate section on the specific pages: Show on only the listed pages (admin/*)

admin/settings/user

Public registrations: Only site administrators can create new user accounts.

This is something I may well change soon once I get the profile module set up.

admin/access

I think the only options I changed here were to allow anonymous users to post comments without approval

admin/block

Because site users don't need to log in or use the admin navigation bar I simply unchecked these 2 blocks from my theme, leaving all blocks disabled, but left them enabled for the admin theme. It would be a bit tricky to navigate otherwise!

admin/taxonomy

It can be a bit tricky to get the hang of taxonomy at first. For a start it uses a posh name for what is essentially 'categories' and the options might not be self explanatory to some (me included). To begin with I simply wanted to categorise blog entries so I created a category called, logically enough, "blog" which only applies to story nodes, has single hierarchy and uses free tagging. I then added the term 'personal posts'. You could keep adding further terms for 'work related' etc etc. By checking the free tagging option you can just add a new category when creating a new post if deemed necessary.

Finally it's time to add some content. If you're like me, this is the hardest part. I managed to scramble together an "About Me" page. As this is a static page linked to from the main menu I created it as a page node with a menu title, set the parent item to primary links and set the weight to determine the position on the menu relative to other items (currently there are no other menu items anyway).

To test out the blog I wrote my first story node, giving it a title, a category (personal posts). Everything else should be OK as default. The blog is affectively the home page but I added a menu item called 'Blog' rather than home and set the path to which basically means home.

Now that's all done. Check out the home page, links and everything to see if it works! Fingers crossed it does but if not it's probably my bad. This recipe is a bit rough and ready so I will try and improve it later as the site does and if anyone spots something incorrect let me know.

Cheers