You are on page 1of 4

Drupal Customization - Modules and Themes Now that we have the base of our site set up, it is time

to make the site look pretty, and add some functionality. n this tutorial, we set up our default folders for themes and modules, and !ll show you how to enable them, and modify their settin"s.

#irst, we need to understand some of the file structure of Drupal on the server. Drupal!s base install sites under our $var$www folder, for our purposes. f you do a ls to list the contents of the directory in $var$www you will notice that there is a themes directory, and also a modules directory. This is not where you put your downloaded themes and modules. I repeat, do not put your downloaded themes and modules in these directories.

%hy you ask& 'ecause this is where the core modules and themees for drupal "o, we want to create different folders for thin"s that we add on. That way, later when you up"rade from Drupal (.) to Drupal (.*, you do not have to worry about overwritin" the modules and themes you have already downloaded, you can simply copy and paste the new install ri"ht into your root directory. f this is confusin", then for now, +ust trust me, and do not put your new themes or modules in these folders. %here do you put them then& ,reat -uestion. f you remember back to an earlier tutorial, when we modified our settin"s.php file, it was located in $var$www$sites$default /nythin" you put in that default folder, will be applied to your default drupal installation. n our case, that is our 0N12 drupal installation, so we can now make new directories under the default folder called themes and modules

33note to advanced users. f you had multiple sites and wanted them all to share fromt he same themes and modules, you can put these directories under $var$www$sites$all and they will be available to all sites you create on this server.33

4o, lets make those directories

sudo cd /var/www/sites/default sudo mkdir themes sudo mkdir modules

Con"rats. 2ou now have directories where you can download additional functioinality for your site. Now, obviously, if you want to add a module to Drupal, you will put it in the $var$www$sites$default$modules folder, and if you want to add a theme, you will put it in the $var$www$sites$default$themes folder. 'ut where do we "et new themes and modules& Drupal.or" of course. 0nce there, you will see a downloads block at the top ri"ht of the pa"e. Click on either modules or themes. 2ou may be overwhelmed, because one of the most amazin" thin" about drupal, is how many contributed modules there really are. 2ou can do +ust about anythin" with the modules that are provided for free ri"ht off Drupal.or". f you "o ahead and si"n up for an account, you can also filter by what version of Drupal you are runnin", which in our case is (.

5ere is a list of modules that

use often6

audio captcha captcha7pack cck 8this is a must9 dhtml7menu 8another must9 fckeditor 8this one re-uires some additional confi"uration, but it provides the editor for when you post in the forum, or comments, and so on9 ima"efield imce +stools pathauto 8must.9 private 8 create desi"n notes and tutorials and keep them private until !m ready to publish9 views 8M:4T9 views7bonus

To download and install a module, you have to chan"e to the directory, and then w"et them into your modules folder. Then untar the file, and then "o into drupal to enable the module. 33note, if you administerin" drupal on a remote server via ftp, you could download these modules to your machine, put them in the folder, and then ftp them up to your server33

4o, lets try this, will use the audio module as an e;ample. This enables a user to upload and play music or podcasts ri"ht on their site. #ind the module in the downloads section of the drupal.or" site. #ind the direct download link, and ri"ht click on it, and do copy link location. Then we can copy and paste that url into our w"et in the command line. 4o do the followin" in the command line6 cd /var/www/sites/default/modules sudo wget http://ftp.drupal.org/files/projects/audio-5.x-1.3.tar.gz You should see the file successfull dow!load. "ow lets u!tar it. sudo tar xfvz audio-5.x-1.3.tar.gz That will untar the file ri"ht into your modules directory. That!s it. Now all you have to do is "o over to your web browser and enable the module in Drupal. 1ets do that now. 0pen your browser and navi"ate to the administer--<site buildin"--<Modules pa"e. 0r "o directly at http6$$localhost$admin$build$modules

5ere you will see all of your modules for the site. 2ou can enable and disable them, and play around with them as much as you!d like. #or now, lets look for our new audio module. 2ou should see it ri"ht at the top of the list, since they are sorted alphabetically by cate"ory. 2ou will notice that some of the core functionality of the audio module relies on the =iews module which i listed earlier. ,o ahead and download and untar =iews, and then come back here and enable both modules. ,ood luck. Now that we have a few modules installed, lets "o ahead and pick a theme. 5ead over to drupal.or" a"ain, and "o to the themes download pa"e. /"ain, make sure you are downloadin" a theme for drupal (. 0nce you find your theme, we are "oin" to "o throu"h very similar methods of downloadin" and installin". >i"ht click on the direct download and do ?copy link location?. Now head to the command line and "et into our newly created themes directory. sudo cd /var/www/sites/default/themes sudo wget #whatever theme ou wa!t to dow!load direct $%&' sudo tar xfvz #the file ou just dow!loaded' This will chan"e to your themes directory, download the theme you have chosen, and untar it to your directory. @lease note that you need to substitute the direct location of the them you want to download above, and do not use the brackets. Now navi"ate on over to your /dminister--<4ite buildin"--<Themes pa"e, or "o directly to http6$$localhost$admin$build$themes and you will see a list of themes. 4everal themes are installed by default, but you should also see the them you +ust downloaded in this directory. ,o ahead and check enabled, and default. 2ou should see the theme take over. 5ow simple was that&&

2ou will notice there is now a confi"ure button ne;t to your enabled theme, "o ahead and click on it. 5ere you can confi"ure many aspects of your theme, includin" uploadin" your custom banner and choosin" some formattin" options of your site. 2ou now have the power of Modules and themes in your "rasps. 2ou can administer the settin"s of you modules over at the administer by module pa"e, http6$$localhost$admin$by-module which will "ive you a lot of control over your modules. ,ive it a try. /lso take a look at blocks and Menus in preperation for our ne;t tutorials.

Chad %ollenber" ABBC

You might also like