Skip to main content

How to Add More Functionality

Submitted by jessica on Wed, 02/28/2018 - 16:54

This post is for anyone who is new to drupal, and is wondering how to install new modules. Almost any type of function can be added to drupal by installing modules. You can do this in 3 ways, using 3 different tools:

  1. The Interface
  2. SFTP
  3. Drush: a command line prompt

The Interface
This is the easiest way. Let's just say, you want to use Adsense on your site. After a quick google search, or a drupal search, you might find this one: Google Adsense Integration. Scroll down to the bottom and look for the link called tar.gz. Right click it, and copy it. Then, in another tab, log into your drupal site, and click on "Extend" in your second top horizontal menu. Look for the blue button called "+Install new module" and click it. You will see the option to install it from a URL which is the easiest way. Paste the tar.gz link in the "Install from a URL" field. Click install, and bingo, you are done. Alternatively, you could download the tar.gz file, go to "Upload a module or theme archive to install," upload the file and the install it. The last step is to enable it. Go to "Extend" in your second top menu, find your module, check it, scroll to the bottom, and install it.

Another way is to use an SFTP client to connect to your web host, and transfer the module directory up there. First download the zip file for the module to your computer and then extract it. Once you have done that, you will see your module directory. In the case of Google Adsense Integration, it will just be called "adsense." Now it's time to SFTP. Your web host will be able to provide you with your SFTP account information. If you are hosting multiple sites within your drupal installation, and you want the module to be accessible to all of the sites, navigate to /code/core/modules/contrib and upload your module there. If you want to only want your module to be accessed by one site, go to /code/sites/all/yoursite/modules/contrib and upload it there. If you only have one site, you can upload the module to /code/core/modules/contrib or /code/modules/contrib. Afterwards, don't forget to enable it. Go to "Extend" in your second top menu, find your module, check it, scroll to the bottom, and install it.

Drush is a shell interface for managing Drupal from your cloud server command line. It is faster than the first 2 methods, and is favored by developers who are comfortable working without a GUI (Graphical User Interface). If you are using Drush, the commands to install and enable a module are

drush dl module_name
drush en module_name