Who love to Drupal

Archive for the ‘Drupal’ Category

Drupal 6 & 7

Showing node count per term in views listing

Posted by drupallovers on July 28, 2014

Here are the step needed to show the count of nodes that are tagged with each term in a term list view!

  1. In your term list view, add a relationship (in the ‘Advanced’ section, which is collapsed by default) to the nodes tagged with that term.  In my example, my term is called ‘Topic
  2. When you are configuring this relationship, you have the choice to exclude terms that don’t contain the relationship (so to exclude terms that have no nodes tagged with it) or not.  In my case, I want to display all terms, even if they have 0 nodes with that topic, so I will leave that box unchecked. I have also renamed this relationship to make it easier for me to reference in the future:
  3. Next, we want to enable aggregation in our view
  4. Finally we are ready to add node info along with each of the listed terms.  Go back to the ‘Fields‘ section of your view and add a node field.  We won’t actually display it, but will just use it for counting.  In my example, I’m choosing to add ‘Node: nid‘ because that’s unique.  After you add your field, it’ll ask you what type of Aggregation you want, since we enabled aggregation for this view.  Choose ‘Count DISTINCT
  5. If you just leave the field like that, you’ll see that it’ll print out the count of the node nids for each of the taxonomy terms it has listed, but it won’t be very pretty!  So, in the configuration screen for this field, I prefer to have the following settings.  Note that I am not including a label and am surrounding the field output with parentheses:
  6. Now your view output should be something like this:
  7. To make it even better, let’s click to edit the Field Settings in the ‘Format’ section.  We can make these fields inline, so they appear in one line
  8. Now, this will be your final output




Posted in Drupal, Drupal7 | Leave a Comment »

30+ Essential Drupal Modules

Posted by drupallovers on April 19, 2012

  The Big Three

“The big three” are important enough that they deserve a category of their own. Most drupal modules worth using have integrated with one of these three. Their importance simply can’t be stressed enough.

  • Content Construction Kit (CCK) – Part of drupal 7; still a contrib in drupal 6. Allows you to define new content types (e.g. blog entry, event, or employee record…) and add “fields” to them. A field could be plain text, an image, a flash video, or whatever. You can also adjust how these fields display in the live view. No drupal install should be without this module.
  • Views – Broadly speaking, this module empowers non programmers to build dynamic streams of content displaying any number of fields. The content may come from nodes (a.k.a. content types and fields), users, system log entries, etc. You can display this stream in any number of formats including RSS feeds, tables, or just the vanilla view for a content type. You can also create pages or blocks — its very tightly interwoven with drupal. Nearly every drupal module worth using is integrated with this module. Extremely powerful when used in combination with CCK.
  • Panels

    I believe Panels + CCK & Views is a hint at what drupal will look like 3 years into the future. I had to change my pants after the first time I witnessed it. At a very simple level, you could think of it as a layout manager. Create a 1,2,3 column layout. Or a 3 column layout with a full width footer and header, and plop pieces of content in them — say a view, a block, or a node. That description, however does not do it justice. Since version 3, its positioned itself as a replacement for drupal core’s clunky block system. It can now override a node page, and can be used to place content all over the place. It also introduced a concept of contexts, selections rules, and relationships. These are concepts that deserve a series of blog posts, but lets just say its solving some of the weirdest, mind numbing, bug creating problems found in advanced websites. Ironically, I used to hate this module, but after version 3 I will defend its awesomeness to the death!

For Administration Sanity

  • Admin Menu – Quick Dropdown menu to all admin areas. Makes any setting only a click away, instead of 3 to 6 clicks away.
  • RootCandy – A theme specially designed for administration. Drupal 7 comes with an admin theme included, but this is still highly recommended in drupal 6.


Content and SEO

  • Pathauto – Automatically create human readable URLS from tokens. A token is a piece of data from content, say the author’s username, or the content’s title. So if you set up a blog entry to use tokens like [author-name]/[title] then a blog entry by “Phil Withersppon” titled “my great day” will be rewritten example.com/phil-witherspoon/my-great-day.
  • Printer, email, and PDF Versions – There are still people out there who prefer to print out content to read later. This module does just that, and also lets them send your content via email.
  • NodeWords – A very poorly named module that’s great at letting you edit meta tags.
  • Page Title – Lets you set an alternative title for the <title></title> tags and for the <h1></h1> tags on a node.
  • Global Redirect – Enforces numerous well thought out SEO rules, for example since I don’t use this module you could access my content at “http://www.nicklewis.org/node/1062&#8221;. This module however will search for the alias and 301 to the proper URL http://www.nicklewis.org/40-essential-drupal-6-modules. (thanks Jeff!)
  • Path Redirect – Simple idea: make it easy to redirect from one path to another. Does a good job at it.
  • Taxonomy manager – Makes large additions, or changes to taxonomy really really easy and painless.
  • Node Import – Made it shockingly easy to import 2000 csv rows, tie rows to CCK fields (or locations), and even will file it under the right taxonomy terms in hierarchy so long as you plan ahead.


  • Menu Block – Lets you split menus into separate blocks based on depth. Say you have a top level menu link “Articles” with sub menu links “Politics”, “Technology”, “lifestyle”. This block would let you show the sub menus in the right sidebar, and the top level “article” as tabs in the header.
  • Taxonomy Menu – Automatically generate menu items for categories. Handles syncing between taxonomy and menus, and is ready to be used in conjunction with views or panels.
  • Custom Breadcrumbs – Set up custom breadcrumb paths for content so that every page doesn’t just have a breadcrumb back to “home”. (note: i’ve used menu_trails a lot too.)
  • Nice Menus – Drop down menus (for people who are into that kind of thing).

WYSIWYG Editors + Image Uploading

  • WYSIWYG API – The standard integration module.
  • CKEditor – Currently my favorite WYSIWYG editor. WYSIWYG API only supports CKEditor on its dev version (at the time of this writing). For the time being, I use this module instead of WYSIWYG api. Regardless, the rest of the world probably uses WYSIWYG api.
  • IMCE – File browser / image inclusion for WYSIWYG editors. CKeditor is integrated out of the box, WYSIWYG API implementations require a bridge module.

Video and Image Handling

  • Filefield – Base CCK file upload field. Useful on its own, but also required by other essential modules.
  • ImageAPI, ImageCache, Imagefield – These three work together. ImageAPI handles low level integration with server side image processing (e.g ImageMagick). ImageCache allows you to set up presets for automatic resizing, cropping, and a host of other operations you’ll probably never need to use. ImageField then provides an upload field to a piece of content, which you can use imagecache presets to resize in the display. Imagefield is very well integrated with Views and CCK. The paintings on the right show a bunch of images automatically resized using this technique.
  • Lightbox2 – If you’ve set up your imagefields, lightbox2 lets you add another layer of options. For example, display image resized at 300px wide on the page, but blow it up to full size when clicked. Like Imagefield, lightbox 2 is well integrated with Views and CCK. Very powerful combination.
  • Embedded Media Field – Embed video and audio files from dozens of third party providers ranging from youtube, to services you’ve probably never heard of.

User Profile, Ratings & Notifications

  • Content Profile – The core profile module sort of sucks. This turns profiles into nodes allowing you all the options of views and CCK.
  • Voting API + Fivestar – The standard voting widget of Drupal.
  • Notifications – Provides the ability to send emails when someone comments, or replies to a comment. Has a host of other features.
  • Captcha + Recaptcha – Standard Antispam system. In use on this very site.

Stuff Marketers Will Love

  • Webform – We all know visitors love filling out forms. This module lets your marketing team create custom forms, and collect whatever info they want.
  • Google Analytics – Simple integration of drupal with google Analytics.
  • Service Links – Easy “share this” links for content. Supports digg, facebook, delicous and a bunch of other social web 2.0 services.

Events and Calendars

  • Date – CCK field for handling dates, and date ranges.
  • Calendar – Integrated and controlled by views.

Location and Mapping

  • Location – Standard API for collecting addresses and lat/long. Integrated with Views and CCK. Somewhat difficult to use, but its a somewhat difficult problem it solves.
  • Gmap – Display locations in GMap.


For Developers

  • Devel – Offers an enormous amount of information for developers, including: theme template variables, and overrides, browsable data structures, and datasets for performance-tuning. Just the debug function dsm(); makes it worth the download.
  • Backup & Migrate — Greatly eases the pain of moving changes from your local development environment to the live server and vice versa.
  • Drush – Its actually not really module, but a “Swiss army knife” set of tools that are run from a command line. One example command is “drush dl views”: running it will automatically download the latest version of views and place it in the right drupal folder. 1 second command instead of a 1 minute process of downloading from drupal, uploading via FTP. There’s many other commands that are just as useful.


Lists like this can be outdated within six months. Always be on the look out for better and better modules.

Posted in Drupal, Modules | Leave a Comment »

Custom Search Module for Drupal

Posted by drupallovers on March 30, 2012

The Drupal core provides a Search module which is great for many sites. However, it doesn’t provide some of the more sophisticated features that some sites need. The Custom Search module is a good alternative if you want more control over what gets searched, who gets to search, and what results you see.

The Custom Search module adds layers of control and sophistication to the core search module. It’s easy to install and understand, and will give you more control over the search functions on your site. It also integrates with other search modules and APIs.

The core search function and the Custom Search module


The basic elements of the core search module are:

  • A block for front-end display. There is very little configuration available for this block. I’ve named this one “Core Search Block” to make it easy to distinguish from the customized one We’ll be creating.
  • Advanced search is available on search results page. If a user clicks Advanced Search on the results page, a form opens up so you can refine your search. (When using the Garland Template).

This gives you a sophisticated search, but little control over how it’s implemented throughout the site. A good way to expand on this is to add the Custom Search Module. Here’s a summary of the added options.

Basic options:

  • Select which content type(s) to search,
  • Select which specific module search to use (node, help, user or any module that implements search),
  • advanced criteria

Advanced options:

  • change the default search box label,
  • add a default text in the search box,
  • add advanced search criteria,
  • change the default submit button text,
  • use an image instead of the submit button,
  • change the order of all the elements,
  • include some elements in a popup block,
  • add a filter to the results page,
  • show/hide basic and/or advanced search in the results page,
  • show/hide meta data in the results page,
  • multiple search paths

Step 1. Download and install the module

Step 2. Enable the module and its sub-modules


There are three included sub-modules:

  • Custom Search Taxonomy: taxonomy options for the search block.
  • Custom Search Blocks: provides additional search blocks, with different settings.
  • Custom Search Internationalization.

Step 3. Set Permissions for users and administrators

  • The confirmation message will have a link to the permissions. Click it to go directly to the permission settings.
  • Set user and admin permissions for two modules. I wanted everyone to be able to search so I gave anonymous users and authenticated users permissions by checking the boxes
  • You have four sets of permissions to set.
    • Custom Search
      • Admin
      • User
    • Custom Search Blocks
      • Admin
      • User

Step 4. Configure the module

  • Return to the Modules page and click Configure. You can also get to the configuration screen by going to Configure > Custom Search
  • When you land on the configuration page the selected tab will be highlighted. You will be going through all the tabs to complete the full configuration. So when you complete the first page, choose another tab and continue
  • I’m not going to go through every single configuration step. The choices are easy. If you have a need to create refined searches, they will make sense to you. If not, trial and error is the best way to get familiar with them. In this demo I’m going to enable everything.
  • There is one section that may need a little explanation – the Search Blocks tab:
  • Select the number of blocks. One of the great things about this module is that every block can have it’s own configuration settings. Suppose you wanted a block on the home page that searched the entire site, but not the forum. On the forum page you want a block that only searches the forum. In that case you would create two blocks. If you wanted anonymous users to be able to search just some forum topics, and registered users to have more option, you would create 3 blocks, and control which one shows by who’s logged in.
  • I’m just going to create one for this demo. Once you decide on this, add blocks to your site.
  • Be sure to save before moving on.

Step 5. Add blocks to your site

  • Go to Structure > Blocks.

Step 6. Assign blocks to regions

  • The custom search blocks you created will be visible and numbered.
  • Choose the regions for the blocks.
  • The new block is added.
  • The original block created by the core is still there. It’s default label is Search Form. I can’t think of a reason why you would want both of them on the same page unless you’re writing a tutorial, so you can remove the original if you want.
  • Be sure to Save Blocks before you try any configuration.

Step 7. Customize the blocks from the front end


Here are both blocks, the original core search block and the one I just added. Compare the look of the Core one with the first image. You’ll see that some custom features have been added. The first picture just shows an entry field and a search button. Now we can search tags and forums. This is because the new module makes those capabilities available to all the modules.

It also makes customization very simple. When you are viewing the module from the front end, mouse over the title and you will see an icon that looks like a cog from a gear.


This will give you access to the configuration for this particular module. It makes it much simpler if you are going to have multiple search boxes with different types of search. You can define each one while you are on it’s page. It saves time and prevents mistakes.

Step 8. Configure Visibility

  • Clicking Configure will allow you to change the visibility and normal block function.
  • Clicking Custom Search configuration will give you access to define the search box itself.

Step 9. Configure each block to have custom features


From here you can configure what’s include and what type of search you want.



Above you can see what the original search block looks like after I’ve configured some additional elements to show. This will allow you to present a highly customized search experience to your the public and authorized users.

Posted in Drupal, Drupal7, Modules | Tagged: | Leave a Comment »

Multiple Categories with the Drupal Contact Module

Posted by drupallovers on March 30, 2012

The Drupal Contact module is often replaced by the Webform module. However, it can be useful in some situations. For example, image that you have different departments and you want each of them to get a different contact form on your Drupal website. If you’re willing to keep it simple, you can do everything you need with the core Contact module and won’t have to install anything else.

It all depends on knowing how to create categories and blocks.

Step 1. Make sure the Contact module is enabled

  1. Click Modules
  2. Click Save configuration.
  3. Click Configure next to Contact.

Step 2. Add and edit categories.


Click Add category to add a new one.

There is a default category called Website feedback that you can use as well, but we are showing you how to add extra ones. You can edit the default category later if you need to.

Step 3. Configure the category

  1. Give the category a name.
  2. Specify the Recipients
  3. Create an Auto-reply message.
  4. Set Selected. Yes means it will be the default contact form. Since this is a new category, you probably want this to be No. You can only have one default.*
  5. Be sure to click the Save button.

*Selected: When a visitor clicks on the link to the contact form, the categories will show in a drop down list. Whichever one is chosen with a “Yes” will show automatically If you want your visitor to be forced to choose a category before submitting the form, make all of these fields “No”

Continue repeating the process until you have all the categories you want. A “category” can be a different department, a group or individual.

Step 4. Enable the menu link


Jump to the Menus administration page by clicking the blue link in the instruction paragraph. Alternatively you can get their via the admin menu and clicking Structure then Menus.


Step 5. List the links


A Contact menu item (disabled by default) is added to the Navigation menu, which you can modify on the Menus administration page. Click list links next to Navigation.

Step 6. Enable the link


This menu link will go directly to the site-wide contact form. You will see a Contact menu item that is disabled. You can use this one as a guide for creating other menu links.

Step 7. Configure the link

  1. Edit the link title if needed.
  2. Enable the link so it appears on the menu.
  3. Choose the parent link if you want it to be different from the default “Navigation”.

Step 8. Add a block with instructions for the user


Go to Structure > Blocks.

Step 9. Add a block


Step 10. Add the block information

  1. Enter a Block Description. This will not be seen by the public.
  2. Enter a Block Title. This will be seen by the public.
  3. Write your instructions. This will also be visible to the public,

Scroll down the page.

Step 11. Set the visibility settings by assigning it to the Contacts page

  1. Choose “Only listed pages”. The only page we want to have these instructions is the Contact page.
  2. Write “contact” in the text field.
  3. Save the block.

Specify pages by using their paths. Enter one path per line. The ‘*’ character is a wild card. Example paths are blog for the blog page and blog/* for every personal blog.is the front page.

There are other parameters and settings on this page, but for the purpose of this tutorial we only need the basics.

Step 12. Enable the block


You will be returned to the Blocks page. You will find the block you added in the Disabled list with the title you created. To enable it, choose the position from the drop down box.


Choose Help.

This box lists all of the regions available on the template you are using. On the Bartik template, the Help region is right where we want it. You may have a different idea or location on your website.

Step 13. Final configuration then save.


As soon as you choose the region, the block title will now be visible at the top of the page that shows the enabled modules. The will be grouped by region, so this one will be under Help.

Remember to Save – scroll to the bottom of the page


No changes will be saved until you click Save blocks.

Your result


If you followed all these steps you will have a contact form that looks something like this.

  1. There is a link on the menu to the form.
  2. The instructions are in the Help Region in a block you added.
  3. The correct email address shows. (this will change to the right one when the category is selected).
  4. There is a drop down list with the categories you created.

Posted in Drupal, Drupal7, Modules | Tagged: , | Leave a Comment »

Getting Started With Drupal’s Webform Module

Posted by drupallovers on March 30, 2012

Webform is the module for making forms and collecting information from users in Drupal.

After a submission, you can send users a thank-you email as well as sending a notification to administrators. Results can be exported into Excel or other spreadsheet applications. Webform also provides some basic statistical review and has an extensive API for expanding its features.

If you need to build a lot of customized, one-off forms, Webform is a more suitable solution than creating content types and using the CCK or Field modules.

Download the Webform Module


Go to this url http://drupal.org/project/webform, and download the Webform Module.

There are some additional modules that add some functionality and make some operations easier. You can download the optional modules as well. To keep things simple, we’ll use the basic module and show you how to create a simple survey of registered users.


Download the correct version. They may have changed since we wrote this, so be sure to check.

Install the Webform Module


Enable the module


Go to the Modules page and scroll down to Webform and click the check box. Click Save configuration.

Access the form fields


Go to Structure > Content types


Scroll down to Webform and look the right for the links to edit and manage fields and the display.


Click Edit

If you are familiar with CCK in Drupal 6, or Fields, which is now part of D7 core, you will see a familiar interface for adding and managing new fields.


This is not the place where you will be creating forms. Editing here is exactly the same as editing Fields in Content Types, which is a way to make fields available to this content type. From here you can edit fields, manage existing fields, the display and the comment functions by clicking on the appropriate tabs. But creating the actual form is done by adding content in the same way you would add an article.

You won’t need to do much here but review all your choices and see if there is anything you feel you must change. The default values will work for the purposes of our demonstration. After you create your first form and understand the module you might want to revisit the configuration.

Now that the module is installed and the configuration is checked, you can begin building your survey form.

Create your first webform by adding it as content


Go to Content > Add Content > Webform

Don’t get confused over Poll vs Webform. We are creating a form with various types of questions, not taking a Poll. Poll is another content type that is similar, but restricted to multiple selection fields and gathering the statistics on the responses. Webform is a form submission module, and collects the actual responses and stores them in a table for you to review. You can collect almost any type of data using Webform.

Create the basic form details


Give it a title and make the decisions on all basic options. Save this with the save button at the bottom of the page.

Add form components


Now you will see the controls for creating and editing the rest of the form elements. Start adding Form components on the WEBFORM tab.


Give the component a label, choose textfield and then click Add.

We’re surveying registered users, so we are going to automatically fill in their username. A name is basic text field, but we want our registered users to show up on the textfield, so we’re going to make use of Tokens. Using Tokens is just an optional feature.


Enter the token %username in the Default value field.

This will pull the username from the data base and fill it in automatically.

If you don’t see the TOKEN VALUES, you probably don’t have the Token module installed. You only need Token if you want to fill in the default values taken from the data base. If this is going to be a blank field that the user will fill in when they visit the page, you can just leave the Default value blank. I used Token here to illustrate the possibilities available to you.

If you need the Token module you can download it here http://drupal.org/project/token

Scroll down the rest of the page and make any configuration selections you need then click Save Component at the very bottom of the page.

Create a “Select” field


Fill in a new label and choose the Select options type from the drop down. Click Add and complete the options on the next screen

Create the list of options


Go to Options and create Key Value Pairs. These pairs consist of a machine readable key and a plain language value separated by a “|” – This character is called a “pipe” and you can find it by holding shift while pressing the backslash key “\” key on most keyboards.

Key-value pairs MUST be specified as “safe_key|Some readable option”. Use of only alphanumeric characters and underscores is recommended in keys. One option per line.

Save the Component.

Repeat this step for the flavor of the jelly and type of peanut butter.


When you are creating lists, the default type is radio buttons. If you want check boxes or a listbox the choices are farther down on the page. You can also set the field as mandatory or optional. If you click the “Multiple” check box at the top, the list will appear as check boxes. If you choose “Listbox” under DISPLAY you will have a drop down box. Selecting “Multiple” and “Listbox” will allow users to make multiple selections from a dropdown box.

When you create the Jelly type, add Other as a choice. Then add a text field so people can write in their suggestions.

Add a Text field


You can add a text field, or a textarea. A text field is for short entries like names. A textarea will be a large area for entering more extensive written responses.

Other field types you might want to add for your purposes are an E-Mail field or Date Field. You can choose thees types from the dropdown “Type” box.


You can choose other field types from the Type drop down.

Add a preset field type


There is a convenience feature you may want to use. You can create pre-built option lists and add them to your form. The module comes with several default lists. Add one for States if you want to see how this looks on your form. Label it State and then choose the Select Options type and when you get to the next screen, make your selection.


Choose US States from the drop down.

Check your form


At this point your form will look similar to this. You can change the locations of the descriptions by clicking the WEBFORM tab and editing each item and making different configuration selections. Once you have the form ordered the way you like it and all the questions and fields correct. Go back to the WEBFORM tab EMAIL tab and set the EMAIL options.

You can use drag and drop to move form elements to different positions.

Configure the E-Mail options.


Go back to the WEBFORM tab and look for the E-mails sub-tab. Fill in an address and click Add.

Set the email address if you want to receive an email when the form is submitted. You can add multiples.


There are lots of choices to make. Be sure you check every one of them so they are correct for your form. Be sure to save the changes.

Configure the Form Settings


From the WEBFORM tab Click the Form Settings sub-tab at the top of the page. Check and modify settings as needed. Save your changes.

Now you can publish your form exactly like you would publish any other content item on your site. After you’ve had a chance to collect submissions, you will see the results when you are logged in as a user with the correct permissions.


Click Content > Find Content and select the form from the content list and you can find the results tab. This will allow you to see the collection of data you have as well as give you some simple analysis.

Posted in Drupal, Drupal6, Drupal7, Modules | Tagged: , , | Leave a Comment »

Using the Views Slideshow Module in Drupal 7

Posted by drupallovers on March 30, 2012

Slideshows are one of the most popular things that people want on their website and the Views Slideshow Module is the most popular way to create slideshows in Drupal.

So, it’s no surprise that Views Slideshow is one of the most popular Drupal modules.

Creating a Views Slideshow isn’t too difficult, but there are a quite a few steps to go through. If you’re a beginner, this will be a complete installation guide.

In this tutoirial we’re going to build a slideshow that will show rotatings testimonials in a block on our site.

Step 1. Install the necessary modules and files

To start, you’re going to need the following 5 or 6 modules to use Views Slideshow. Install and enable all of them.

You’ll also need to install jQuery which will make the slideshow work.

  • Be sure the Libraries Module is installed.
  • You need to install the jQuery cycle .js file.The process is a little different than a module installation. Start by saving the file from here: http://malsup.com/jquery/cycle. Click the download link on the site and it will open the actual file. Save the file to your computer.
  • Login to access your Drupal site files and browse to the /sites/all/ folder. Create a directory here called /libraries/.
  • Now create another folder inside /libraries/ called /jquery.cycle/. The full path to this folder will be /sites/all/libraries/jquery.cycle/.
  • Copy or upload the file jquery.cycle.all.js to the same folder. The full path will be /sites/all/libraries/jquery.cycle/jquerycycle.all.js.

Step 2. Create an image style for the thumbnails

  • Go to Configuration > Image styles > Add style.
  • After you click Add style you will be prompted to give the style a name. Name the new style testimonial_thumbnail.
  • Choose Resize from the Effects menu. Click Add.

Set the size of the testimonial_thumbnail. Make it small, 75×75 should work. Click Add effect.


Step 3. Create a new content type

Go to Structure > Content types > Add new content type.


Create a content type called Testimonials. Click Save and Add Fields when you are finished.


Step 4. Add an image field

  • Add a new field named Testimonial Image.
  • Add the field name testimonial_image.
  • Choose Image as the type from the drop down,
  • The form element will select itself.
  • Click Save three times until the field is created.

Step 5. Add a link field

  • Add a new field named Testimonial Links.
  • Add the field Name testimonial_link.
  • Choose Link from the dropdown.
  • The form element will select itself.
  • Click Save.

You can repeat these last two steps step for as many fields as you want to add to the Testimonial Content Type. I’m going to add one more called Signed. It will be a text field where I can put the name of the person who left the testimonials.

Step 6. Manage the display of the fields

Click Manage Display to edit the way the fields are displayed.


We’re going to specify the image style to be used with this content type.

  • Adjust the positioning of the fields as needed using the drag and drop method.
  • Click the cog icon on the Testimonial image row.
  • Select the image style from the dropdown menu.
  • Choose testimonial_thumbnail. This is the image style you created back in Step 2.
  • Choose the link destination. (in this picture it’s hidden below the style drop down.) You probably want it to link to the content.
  • Click update.
  • Make any other changes to other fields you want.
  • Click Save at the bottom of the screen.

Step 7. Define the elements that make up the teaser

  • Look for the Teaser button toward the top right of the window. Click this to set the length of Teaser text and other details.
  • The Teaser settings show you that only 600 characters will be used for the teaser text. To change it click the cog icon.
  • Also, make sure the fields Signed, Testimonial Link and Testimonial image are set hidden in the teaser.
  • Click and drag the plus sign next to Testimonial Image.
  • Move it above the Hidden Field label so it will be part of the teaser.
  • The hidden fields will show in the full testimonial, but not in the teaser.
Now you have finished creating the fields and display for the Testimonials content type. Now we need to go and work with Views to complete the slideshow.

Step 8. Add the View

  • Go to Structure > Views > Add a new view.
  • Enter the settings below. Make sure to define the view as a block.
  1. Name it Testimonial Slider.
  2. Check Description and give it a description.
  3. Choose the to Show Content and then the content type you want to show.
  4. Uncheck Create a page.
  5. Check Create a block.
  6. Type Testimonial Slider into Block Title.
  7. Choose the Slideshow Format made up of teasers.
  8. Decide the number of items to show on the page. Use “0” if you want to scroll through all testimonials. Otherwise it will loop through 5 of them.
  9. Click Continue & edit

Step 9. Edit the View

  • Click on None under Block Settings.
  • Give your block a name.
  • Click Settings under FORMAT and next to Slideshow.

Scroll through the options and make changes. From here you can add classes, choose the transition type for the slides and and Internet Explorer tweaks. Take some time to look at all your choices. This is where you will control the look and performance of the slides. Be sure to save any changes you make.



Step 10. Publish the block

  • Go to Structure > Blocks.
  • Your new block will now show in the list of disabled blocks, and you can add it to a region like any other block. Add it to the region of your choice. I added it to Sidebar second.

Step 11. Add some testimonials

Now let’s create some content and try it out. Get some sample images to use for the thumbnails and create some testimonials.

TIP: if you want to quickly create sample items with Lorum Ipsum text, you can use a module called Drupal Ipsum, which allows you to just check a box to fill the article with dummy text when you create it. That’s what I used here.


Go to Content > Add content.


Choose Testimonials and create several so you can get a good idea of how the scroller and the block appear.

Step 12. Go to your homepage and look at the result


Your block should now show on your site.

Step 13. Edit the slideshow

Now that we can see the block in action, we may want to make changes. Here’s how to make them:
  • Mouse over the corner of the block so the gear appears.
  • Click the dropdown arrow.
  • Click Edit view

Step 14: Edit the slideshow settings

  • Choose Settings next to Slideshow.
  • In this example, we’re going to change the speed to 700 so that slideshow operates more quickly.


There are a wide variety of possibilities and options available to you with Views Slideshow. You might now want to go back and change anything from the image styles, to the fields, to the content, to the slideshow settings.

This tutorial hasn’t taken you in depth with any of those, but hopefully you now feel confident enough to start to build your own slideshows. You now know where to edit the image styles, fields, content and slideshow settings.

From here, it’s a question of practice and we’re sure you’ll build some great slideshows.

Posted in Drupal, Drupal7, Modules | 2 Comments »

Migrate Drupal 6 to Drupal 7

Posted by drupallovers on March 30, 2012

Changing from Drupal 6 to Drupal 7 is not just a simple update. The steps seem straightforward, but there are major changes in the way Drupal 7 works and stores data. So a move up across major version numbers is really a “migration” as opposed to a simple update or patch.

If your site is fairly simple, with good backups, and you use the right approach, you can accomplish the migration without too much trouble.

The more complex your site is, the more complex the migration will be.

Doing a migration involves several steps. You might want to review these related tutorials.

Step 1: Backup your site’s database


* It is wise to try an update or upgrade on a test copy of your site before applying it to your live site. Even minor updates can cause your site’s behavior to change.

There is a handy tool called Backup and Migrate, which helps simplify the backup process, which you can download from this page http://drupal.org/project/backup_migrate. Note: it only works with MySQL, and is still under development. You should also do a manual backup of your database using phpMyAdmin. We show you how to do this in this tutorial.

Step 2: Backup all your folders and files

You have several ways to do this, and you might want to do it more than one way for safety

  1. You can download all the files to your local computer
  2. Copy the files to another directory on your server
  3. Use the backup facility that is probably built into your hosting control panel

You can’t be too paranoid about having extra copies.

Step 3: Double check to make sure you can complete the upgrade

Check on the Drupal 7 status of your contributed and custom modules and themes.

Step 4: Check for the latest version of Drupal 6.x


You can’t skip versions when you upgrade. For instance you cant go from 6.0 to 6.2 in one step. You also can’t upgrade directly from 6.0 or 6.1 to Drupal 7. You have to have your Drupal 6 installation at the latest level.

How do I know which version of Drupal I’m running?

  • Go to Administer (or Administration) >> Reports >> Status report.
  • You will see your version number if you have Drupal 6.0 or later. In Drupal 5.x and earlier, the path to go to is Administer >> Logs >> Status report.

Where do I get the latest version of Drupal 6? http://drupal.org/project/drupal

Step 5: Take the site off-line


Go to Administer >> Site configuration >> Site maintenance.


Select “Off-line” and save the configuration.

Step 6: Change the theme to Garland


Go to Administer >> Site building >>Themes


Click the check box to enable the theme, and the radio button to make it the default. Scroll to the bottom of the page and save changes.

You need to use the basic theme. If you are using a template, check with the designer to see if there is an updated version, and you can do that upgrade after the site is working with Garland.

Step 7: Disable all non-core modules


Go to Administer >> Site building >> Modules.


You can expand the categories by clicking on the category name and see what is enabled. If you added an additional modules to your site, there will be additional categories. Expand them and uncheck the boxes next to the modules

Step 8: Clear all optional module check boxes


It is possible that some modules cannot be immediately disabled, because others depend on them. Repeat this step until all non-core modules are disabled and all check boxes are clear. Be sure to scroll to the bottom of the page and save the changes.

Step 9: Remove unwanted modules


If you know that you will not re-enable some modules for Drupal 7.x and you no longer need their data, then you can uninstall them under the Uninstall tab after disabling them. The Uninstall tab is at the top of the modules page.

Step 10: Remove sites/default/default.settings.php


On the command line or in your FTP client, remove the file /sites/default/default.settings.php

Step 11: Delete all your other folders and files except /sites/


Empty your Drupal files directory except for:

  • /sites/
  • any custom files you added elsewhere.

If you made modifications to files like .htaccess or robots.txt, you will need to record those changes and re-apply them after the new files are in place.

Step 12: Remove unwanted module folders


If you are abandoning any modules because they are not compatible with Drupal 7, remove them from the directory

Step 13: Download and extract Drupal 7


Download Drupal 7 if you haven’t already. http://drupal.org/project/drupal

You can extract the files on the server and copy them to your main directory. Alternately you could extract them on your local computer and use FTP to move them to your sever.

Don’t worry about overwriting the files in the sites folder. Only the files that need replacing will be replaced.

Step 14: Reapply any changes to your .htaccess file or robots.txt files


Re-apply any modifications to files such as .htaccess or robots.txt. Use a text editor to make changes.

Step 15: Make your settings file writable


Make your settings.php file writable, so that the update process can convert it to the format of Drupal 7.x. settings.php is usually located in sites/default/settings.php

Normally this would best be set at 444, but it needs to be writable so 644 or 666 if you are having trouble will be the correct setting. BE SURE YOU REMEMBER TO COME BACK AND RESTORE THIS SETTING AFTER YOU ARE FINISHED with the migration.

Step 16: Run update.php


Run update.php by visiting http://www.example.com/update.php (replace http://www.example.com with your domain name). This will update the core database tables. Click continue and follow the steps.

 If you can’t access update.php make a change to your settings file:


If you are unable to access update.php do the following:

– Open settings.php with a text editor.

– Find the line that says:
$update_free_access = FALSE;

– Change it into:
$update_free_access = TRUE;

– Once the upgrade is done, $update_free_access must be reverted to FALSE.

Step 17: Backup your new database


Using the same procedure you used before, make another database backup. Save it with a different name or to a different location than your original backup. You may still need that one.

Step 18: Upgrade your modules to their newer versions.

You’ve gone through the core upgrade, but now each module has to be upgraded. Then you can update and re-enable your non-core modules by following these steps:

  1. Check your notes, and the UPGRADE.txt files inside each module, to see if any special upgrade instructions apply
  2. Fully remove the old module directory inside sites/all/modules/ (if you haven’t already)
  3. Download, unpack and move the new module directory to sites/all/modules/
  4. Enable the module
  5. Run update.php again (you should have run it once already when upgrading core) and check for any message output.
  6. Back up your database and files again, between each module update, so that if there is a problem, you can revert to the most recent update.

If you have errors when you run the update.php script:

  1. Note any error messages you see.
  2. Restore your site to its previous state, using the file and database backups you created before you started the upgrade or update process. Do not attempt to do further updates or upgrades on a site that had update problems.

Step 19: Upload your Drupal 7 compatible theme


Make sure everything works in the Garland theme before you switch over to your Drupal 7 theme.

Step 20: Go to Reports and run a Status report


16. Go to Administration >> Reports >> Status report. Verify that everything is working as expected.

Step 21: Set update_free_access is set to false


Ensure that $update_free_access is FALSE in settings.php.

  • Go to Administration >> Configuration >> Development >> Maintenance mode.
  • Disable the “Put site into maintenance mode” check box and save.

Scroll to the bottom of the page to save the configuration.

That should be the last step in your successful migration from Drupal 6 to Drupal 7.

Related Tutorials:

Planning for a Drupal 6 to Drupal 7 Migration

How To Put Drupal 7 In Maintenance Mode.

Migrating Drupal 6 CCK Data To Drupal 7 Fields

Posted in Drupal | Leave a Comment »

How to Set Up Drupal Multi-sites

Posted by drupallovers on March 30, 2012

Multi-sites is a Drupal feature that makes managing many websites easier.

The idea with multi-sites is that you can use a single codebase for more than one website. When you update that single codebase, you update all of your Drupal sites. Each site can still have its own theme, modules and content.

With multi-sites you can have many sites with one database, or many sites with different databases.  In this tutorial we will chose to have multiple sites, each with their own database.

We’re going to set up one core installation, and share those files with two sub-sites. Each sub-site will share those files but have its own URL and its own database. In this tutorial I’m going to set up two sub-sites with different URLs:

Setting up multi-sites is not an easy task for beginners. To make it easier, we’re going to show you how to use your hosting account with cPanel to get this done more easily. If you aren’t using a commercial host with cPanel, your setup process will be slightly different.

Step 1. Choose your master domain name

Your first step is to hoose the URL that will host your main site. As we mentioned, in this example, our main URL will be http://easywebupdate.com.
This doesn’t have to be an important URL. Unless you decide you want it to, this one won’t be used by anyone but you. It’s only going to hold the master copy of your Drupal installation.
It is worth nothing however that this site might be visible if one of your sub-sites fails. So it would be a good idea if your master site had a page with your contact information and a message.

Step 2. Start out by creating databases for all the sub-sites

  • Go to MySQL in cPanel or use the database wizard to create databases for each site you want to add.
  • Be sure to add database users with full privileges to each database. If you want to maximise security, create a new database user for each database. In the example below, I named the databases the same as the URLs. This is recommended on a live site, but it does makes it easy for me to refer to them in the tutorial.

Step 3. Install Drupal in your master URL directory

  • Install Drupal in your /public_html/ directory.
  • Visit the URL (in this case http://easywebupdate.com) and step through the Drupal installation.
  • Use the master database connection information when the install script asks for it.

Step 4. Create a sub-folder for each sub-site.

  • Create a folder under public_html/sites/subsite.com. Substitute the URL you are going to use.
  • Create one folder for each sub-site.
  • Now copy default.settings.php to each one.
  • CHMOD those files to 644 if they aren’t already.
  • If you are doing multi-sites for Drupal 6, you should also create an additional folder called “files” and make sure it’s CHMOD 755.

Step 5. Upload or copy default.settings.php to the new folders

You now need to add default.settings.php to your new folders. The image below shows how file structure looks in Filezilla that makes it a little more obvious.

  • If it is Drupal 6, create a files directory with the path sites/domain.com/files/. You don’t need this extra directory here for Drupal 7.
  • Copy or upload default.settings.php to the folder.
  • Rename it to settings.php.
We are now finished with the Drupal master site. The next part is more complicated because we have to make sure the domain names are correct. Luckily cPanel can do this easily for beginners. We’ll show you that method first. There is a manual method, but it involves making changes in Apache files and this is probably beyond beginner-intermediate skills required of this tutorial.

Step 6. Return to cPanel

  • On the main cPanel dashboard, find the Domains section and click Parked Domains.

Step 7. Add the domain

  • Park the domains on top of the master domain.
  • When you park a domain, the domain needs to be pointed at the DNS servers for your hosting account. If you don’t know how to do this, the proper place to get information is from the domain name registrar. If you don’t know who your registrar is, you get that information your hosting company.

Step 8. Go to your browser and visit the URL

  • In your browser address bar, type the url to your second or third site.
  • Install Drupal by following the prompts.

Step 9. Connect to the proper database

  • When prompted, enter the database information for this specific site.



Three sites, each with their own theme, each with their own modules, all on the same hosting account. To create another site, I just repeat the process. Using cPanel’s parking feature, I was able to avoid the need to make changes to Apache, and the need to make symbolic links or redirects in the .htaccess file.

There is another way to do it that is almost as simple, but if you want to try it you will learn a little more since it involves creating a symbolic link. We’ll give you the code to paste into your site and walk you through it.

Option 2: Quick ways to set up Drupal multi-sites with cPanel Sub-Domains

Go through Steps 1 through 3 of this tutorial. Everything is the same up to that point. In Step 4 you take a slight detour and so Option 2 starts from that point on.

Option 2, Step 4: Create directories for each domain with the convention subdomain.domain.com

  • Create folders for each site you want to create.
  • Create the folder names with this convention subdomain.domain.com.
  • Upload or copy default.settings.php to each directory.
  • Change the name of each copy to settings.php.
  • Return to cPanel home.

Option 2, Step 5: Create subdomains

  • Go to the Domains section and click Subdomains.

The correct directory structure is pictured below:

  1. The directories created by cPanel.
  2. The directories created by you.

Option 2, Step 6: Write a simple php script to create a symlink

In a script editor create a file called mysymlink.php and put the following code into it.

symlink( '/home/cPanel_User_Name/public_html/', 'subdomain' );

In my case the file would look like this


Option 2, Step 7: Upload the symlink script to the main directory

To run it go to your browser address bar and type in your url and the name of the file.


If all goes well you will see a completely blank page. If you made a mistake in the file you will see error messages.


Option 2, Step 8: Add redirection to your .htaccess file

  • Open your .htaccess file in a script editor
  • Find the line # RewriteBase/ and remove the # sing.
  • Add the following line and save the changes


 RedirectMatch 301 ^/subdomain/(.*)$ http://subdomain.yoursite.com $1


Here’s what my .htaccess looked like when finished:

 RewriteBase / RedirectMatch 301 ^/edandrea/(.*)$ http://edandrea.easywebupdate.com/$1 RedirectMatch 301 ^/edsparty/(.*)$http://edsparty.easywebupdate.com/$1

This redirection will make it so the site can be accessed in two ways.

http://easywebupdate.com/edsparty and http://edsparty.easywebupdate.com will both be redirected to the same site.

Option 2, Step 9: Visit your subdomain and complete the installation

If you did everything right, you can visit your subdomain and you will now be asked to install Drupal in your subdomain.

More on Drupal Multi-sites

What you’ve seen in this tutorial is just the beginning of the possibilities with Drupal Multi-Sites. There are many optional ways to arrange the code and the data:

  • Multiple domains or vhosts using different databases.
  • Multiple domains using the same database.
  • Multi-site setup using a single Drupal instance.
  • Same codebase, completely different content and users.

One security concernt to note is that Drupal’s multi-site feature is normally used in situations where the administrators for all of the sites are highly trusted. The reason is that anyone with full administrative privileges on a Drupal site can execute arbitrary PHP code on that site through various means, even without FTP access to the site. That arbitrary PHP code could be used from one site to affect another site if the two sites are in the same HTTP document root and share the same Drupal codebase. For more information: http://drupal.org/node/476544 and http://drupal.org/node/1244642.

Posted in Drupal | Leave a Comment »

Drupal Omega Theming:video

Posted by drupallovers on March 30, 2012

A screen cast by Panoetic director and developer/themer Nathan Lisgo (@nlisgo) on the Drupal Omega base theme.

Topics covered include:

1. Introduction to Omega
2. Preparing site wide settings
3. Preparing alternative layouts with the Delta module
4. Applying context for alternative layouts
5. Using the 960.gs CSS grid framework
6. Using 960.gs with views
7. Responsive web design with Omega and views
8. Omega tools module


Posted in Drupal | Leave a Comment »

Migrating to Drupal

Posted by drupallovers on February 28, 2012

This page contains hints and scripts from members of the Drupal community for migrating to Drupal from other content management systems (CMS) weblog, and bulletin board applications. Migrating from other platforms often requires knowledge of PHP and SQL.

Migration involves mapping data fields from the original application’s database into Drupal’s database. For some applications this can be a simple task, with tools or scripts available to do the migration. Other applications may have complex database schemas, lack documentation, and are uncommon enough that there are no tools available.

The best way to find out if tools or scripts exist for your application is to search on Google. For example a search such as “migrate WordPress Drupal” returns dozens of useful links.

If there are no tools available for migrating from your application to Drupal, you will want to familiarize yourself with Drupal’s database schema, as well as the schema of the application you are migrating.

You will need to map all your current users into Drupal’s users table. If you have different roles (for example, read-only, author, editor/reviewer, admin), you will need to assign your users to properly set up and configured roles in Drupal. This can mostly be done through Drupal’s admin interface, although if you have a large number of users, you may want to find a way to automate the assignment. Editing each user by hand could be time consuming.

If the content being migrated is text, it would likely map into the node and node_revisions tables, with comments in the comments table.

It is usually possible to import databases (MySQL, etc.) containing content and users from your previous CMS into Drupal.

This can be done by exporting the databases first to CSV (comma-separated values) or similar files. Tools such as phpMyAdmin for MySQL can make this task easier. You can then import these files with import/export modules such as Import HTMLFeedsMigrateNode ImportUser ImportCSV Parser, or Transformations (see a module comparison).

Note that content is often imported as Content Construction Kit (CCK) custom content types. If your tables are available in your Drupal database, you can use the Table Wizard to expose them to Views, and then use the Migrate module to copy the data from the old columns to the CCK content types. Also, the Node Convert module can convert imported node types to other node types; it supports, at least, CCK fields, book and forum nodes, and probably others like blog, etc.

In the case that your chosen import module is not yet ready for the Drupal version you wish to use, then there is the workaround of installing a site running on a previous Drupal version just for the import, and then upgrading it.

On the other hand, if you prefer to migrate data into Drupal developing a custom PHP script, see for example Migration tips for some techniques.

Support for migrating can be found on the Drupal.org forum, Converting to Drupal. See also the Drupal group Content migration, import, and export, for discussion of best practices in content migration. Drupal Groups also has a comparison of modules for importing and exporting data.

The following pages describe methods people have used to migrate to Drupal in the past. As other CMS software and Drupal evolve, you can use these as a guide to help with your own.

Posted in Drupal | Leave a Comment »