Drupal

Deploying Drupal via CVS (including modules).

Deploying Drupal via CVS (including modules).

If you're not using version control for your software projects please turn in your geek badge at the door. Seriously, version control makes life so much easier when developing features for a site or deploying a site. The best version control out there currently would have to be Git, subversion a distant second, and coming in last the old and painful CVS. Drupal is currently on CVS, but migrating to Git, we'll have to deal with CVS for now.

Needless to say, these have to be run from the command line

Step One: Installing the Core

In the directory that you would normally download and unzip drupal you'll want to run this command to grab Drupal core from the CVS server

cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal co -r DRUPAL-6-14 drupal
That will grab

  • Drupal version 6.14
  • place all the files in a directory called 'drupal'

Simple, fast, painless.

Step Two: Installing Modules via CVS

Every install of Drupal needs CCK and Views. So here are the commands to install each of them. Now you will want to navigate to your drupal/sites/all/modules directory. From there run the following commands.

This will checkout cck version 6.x-2.6

cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r DRUPAL-6--2-6 -d cck contributions/modules/cck

This will checkout views version 6.x-2.8

cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r DRUPAL-6--2-8 -d views contributions/modules/views

I think you get the picture. Continue this as you see fit.

To see the module version in Drupal you will need to also install the CVS Deploy module. Very important

Step 3: Upgrade Time

Core

So after a while you have to upgrade Drupal core you simply navigate to your root drupal directory and run this command.

cvs update -dP -r DRUPAL-6-15
That will make all the necessary changes to bring Drupal from 6.14 -> 6.15

Modules

For modules you'll want to navigate inside the module directory and run the update command, for example for cck you would go to drupal/sites/all/modules/cck and run

cvs update -r DRUPAL-6--2-7 -dP
That will upgrade CCK from 2.6 -> 2.7

Step 4: Eat some chocolate ice cream

Drupal Simplied Contact form

Drupal Simplied Contact form

A site I'm working on has a simple contact us form in the footer of every page. I didn't want the long drawn out contact form with all the name, subject, email, message fields. Here is what I did.

Installed the formblock module

Easy enough, install the module, enable the block so that the contact form now shows in the footer.

Simply the contact form

Now we want to hide some of the fields in the contact form.

In your template.php file, you'll want to add the following lines.

function basic_theme(){
  return array(
    'contact_mail_page' => array(
      'arguments' => array('form' => NULL)
      )
    );
}
 
/**
 *  Hide and autofill some fields in the contact form.
 *
 */
 
function basic_contact_mail_page($form){
 
  $form['subject']['#value'] = "Website question";
  $form['subject']['#type'] = 'hidden';
  $form['name']['#type'] = 'hidden';
  $form['name']['#value'] = 'Website Customer';
  return drupal_render($form);
}

As you can see I'm using the Basic theme from Drupal. If you're using a different theme you'll want to change the word basic to your own theme (e.g. blueprint).

Now you have a simple contact form.

drupalcontact.png

Drupal Mimemail missing embedded images [Solved]

Drupal Mimemail missing embedded images [Solved]

A really weird bug in Drupal's Mime Mail module. This module allows you to send HTML emails with links to images and such.

Behavior

Create a newsletter, send a test one, works great.
Send it for real and the embedded images are missing.

I initially thought it was poormanscron, but I don't have that installed on this Drupal site.

Jquery Slideshow Plugin for Drupal

Jquery Slideshow Plugin for Drupal

I am now a module maintainer for a Drupal plugin I wrote (Jquery Slideshow). It takes CCK Imagefields and creates a nice Javascript slide show from them using the Cycle plugin for Jquery.

It took some time to write, but it's not that complicated of a module. The module has some settings for using Imagecache and different types and speeds of transitions.

Syndicate content