Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough
Dec 04 2018
Dec 04

The Drupal 8 Rabbit Hole Module allows you to control what happens when someone views an entity page. Before you ask why this might be important, let me clarify, it's not a layout tool. It's a simple module that allows you to easily redirect or prevent users from viewing specific types on entities on your site. If you have content types or other entities that you are using to either build out a view or other area of your site, but don't want users to access the original page for this content type or entity, this is the module for you. If you read this entire description and are still confused, I promise it's very simple. Check out the video to find out how it might be useful for you on a future project.

Nov 20 2018
Nov 20

By shane

Tue, 2018-11-20 00:27


Video of Drupal 8 FlexSlider Module - Daily Dose of Drupal Episode 220

Daily Dose of Drupal Episode #220

Share with Others

The Drupal 8 Flex Slider Module allows you to use the Flex Slider library to build out slideshows on your Drupal website. This video covers how to get Flexslider to integrate with Drupal views as well as Drupal fields.

Nov 19 2018
Nov 19

Video of Drupal 8 Configuration Read-only Module - Daily Dose of Drupal Episode 219

The Drupal 8 Configuration Read-only module allows you to lock down some of your environments to prevent users from making configuration changes. This lets you use the Drupal 8 configuration management system to push up all your changes, while preventing you from changing any settings, content types, views, or any other configuration on your production website.

Nov 13 2018
Nov 13

The Drupal 8 Editor Advanced Link Module allows you to specify additional attributes when creating links in your content. This makes it easy to add a CSS class, an ID, open the link in a new window, or even specify a rel="nofollow" tag. The module is very easy to use, but there is a small trick to getting it set up. Watch the video to see how it's done and start customizing your links in no time!

Nov 12 2018
Nov 12

The Drupal 8 Editor File Upload Module is a great module for allowing your content editors to upload files directly in your website content. If you have ever needed to upload a file, and then include a link to that file, then the Editor File Upload module will be useful. Rather than having to upload the file manually using FTP or through another module, then having to go back to create a link in your content to that file, this module lets you do it all in one step. This saves you (or the other content editors on your site) a lot of time.

Nov 10 2018
Nov 10

The Drupal 8 Image Widget Crop Module is a handy module for allowing your content editors on your website to crop images after they upload them. Have you ever uploaded an image on a website and had it automatically crop the image for you in a way that just looks wrong? This module solves that problem!

Nov 09 2018
Nov 09

Video of Drupal 8 Contact Storage Export Module - Daily Dose of Drupal Episode 215

In this episode, we cover the Drupal 8 Contact Storage Export Module. This episode covers a module that adds additional functionality to the Contact Storage Module (which we covered in episode 213). This module allows you to export your contact form submissions to a CSV file. It's a simple module that serves a very specific purpose. If you need to export your contact form submissions, this is how you do it!

Check out the Code Karate Patreon page

Oct 31 2018
Oct 31

In this episode, we cover the Drupal 8 Linkit Module. This module extends the link functionality of your Drupal 8 WYSIWYG editor (like CKeditor) to make it easier to link to other pages on your website. Rather than having to go find a page on your website you would like to link to, copy the URL, and paste it in the link field, this module allows you to do it in one step!

Check out the Code Karate Patreon page

Oct 30 2018
Oct 30

In this episode, we cover the Drupal 8 Contact Storage Module. This module extends the Drupal 8 core contact module by saving the contact entries in the database. This makes it easy to go back and view, edit, or delete any of the contact form submissions on your Drupal 8 site. It's a handy little module that can save you from needing to install a more fully featured form module (like Webform or Entity Forms).

Check out the Code Karate Patreon page

Oct 29 2018
Oct 29

In this episode, we will cover five different ways to download and install modules in Drupal 8. Yes, that’s right, FIVE different ways! If you are just getting started with Drupal or are transitioning from Drupal 7 to Drupal 8, this is a great place to start. Once you understand all the ways to download and install modules, you can make the decision on which option works best for you.

Check out the Code Karate Patreon page

Oct 28 2018
Oct 28

Lando is what the cool kids are using for their local development environments these days. In this episode, I give you a quick introduction to Lando and show you how it can be used to create a Drupal 8 site in less than a minute. I also show you how you can integrate Lando into your workflow if you are hosting your websites on Pantheon.

Are you using or have you tried using Lando yet? What are your thoughts?

Check out the Code Karate Patreon page

Oct 25 2018
Oct 25

Hello everyone and welcome to another Daily Dose of Drupal, today we are on episode #210. Wow, it's been over three years since I last posted a video, and a lot of things have changed over the last three years, but a lot of things have stayed the same too... after all, you can still follow me on Twitter at smthomas3.

So I'm going to keep this episode short and sweet, but I do have some big news. I'm going to start posting Drupal 8 content, a lot of it. I've been stuck in the Drupal 7 world for a long time, and I just really haven't got the time to put out any new Drupal 8 content. But that's all going to change. So I am going to start posting Drupal 8 content on an almost daily basis going forward. I'm really going to keep doing it until I run out of things to say, and I do have a tendency to ramble on... so we might be here awhile.

So the next big announcement is that everything on CodeKarate.com going forward, and all the stuff I did in the past is all going to be free. Yep, you heard it here first! Just head on over to CodeKarate.com, enter your email, and you will get access to all my ebooks, all the stuff you used to have to pay for. Really I just got to the point where I didn't want to have to save my "best stuff" behind a paywall. I thought it would be better to just post all my best stuff on YouTube and on my website for free. Now what I am asking is if you do find value in what I am posting, head on over to my Patreon page. If you can afford a few dollars a month, it's going to help me to keep posting more and more of this Drupal 8 content. We all know when you get started with Drupal, it can be a little bit intimidating, it can be a lot to learn.

The goal here with Code Karate and the Daily Dose of Drupal is to put out as much Drupal 8 content as possible and try to organize it in a way that someone just getting started with Drupal can understand. So the goal is to keep it free, if you do find value please head over to the Patreon page and maybe just throw in a couple dollars a month, that would be awesome. Also, if you do that, there is a chance you can get a sticker, you can get your own Code Karate t-shirt, and some other cool things for helping me out that you can get by heading over to the Patreon page.

So with this first video, I wanted to mention those few things, but I also wanted to get the discussion going. What are you struggling with in Drupal 8. What's the content or videos that you want to see produced. The goal here is that I'm going to start with doing what I have done a lot in the past which is post videos on Modules and how to use them. But I also want to get into more in-depth topics such as Module development, site building, configuration management, building out Drupal API's to use with either Javascript frameworks or mobile apps, theme building, theme development, any of those types of difficult and in-depth concepts I want to get into that first. I am going to start with the modules and then lead into some of that.

But if you have things with you are struggling with or you would like to see, let me know and hopefuly I can get some feedback from everyone then prioritize what the community in general is really having trouble with. Thanks for checking out Code Karate, thanks for watching this video, and go ahead and buckle your seatbelt because Code Karate is back. We'll see you next time.

Feb 01 2016
Feb 01

[embedded content]

Commercial Progression presents Hooked on Drupal, “Episode 13: Future Predictions of Drupal, Technology, and Powerball Winners".  That's right, you heard it here first folks, someone has already won the Powerball. Ok, so maybe that is old news... but what about the future of Decoupled Drupal website architecture, Static Site Generators, and the next revolution in IOT technology? To receive these clairvoyant predictions along with many important highlights from 2015, you will need to tune into the future with our latest podcast.

Drupal 8 Adoption

Drupal 8 is out and running for 2016, and the Commercial Progression team has already started on their first Drupal 8 projects. We take a moment to consider the trends for adoption in 2016 from the Drupal 8 development community. With the end of life for Drupal 6 announced, decisions will need to be made. Will Drupal 8 prove to be the platform of choice this year for new projects, or will Drupal 7 websites remain dominant as a proven platform?

Decoupled Drupal

2015 was a whirlwind year for technology, web development, and Drupal. With the launch of Drupal 8, we take a moment to speculate on the trends already developing for 2016. Discussions of decoupled Drupal architecture are certainly in the air after Dries' blog post on decoupled Drupal deployments in 2015. What are the advantages and disadvantages of such a setup as opposed to a traditional Drupal deployment? Will the new decoupled architecture be built on React of Angular?

Static Site Generators

Another somewhat surprising development came on the scene in 2015 that seems to have a strong trajectory for 2016, static site generators. Open source web development technology is not limited to the CMS. A new breed of website creation tools like Jekyll and Middleman are gaining popularity as easy to use tools for quickly creating responsive websites. The modern open source CMS comes with many advantages, but one downside is the need for steadfast vigilance on security and updates. The brochure site may be a good candidate for a static site generator vs the full on CMS build with their long term security concerns. Right now, there are over 400 static site generators available... which ones will win out in 2016? Brad Czerniak boldly predicts...

Jekyll has already won out the static site generator space. Jekyll is the answer. Anyone who chooses a different static site generator is wrong.

...citing the selection of Jekyll for the new Healthcare.gov website. Jekyll also comes with hosting support by GitHub (GitHub Pages currently run on Jekyll), a pretty nice selling point... FREE.

The Internet of Things

We predict IOT will continue to be a hot topic of growth in the technology space for 2016. Install your Nest, automate your kitchen appliances, and bring IP connectivity to every object in your home. But be safe, someone could hack your light bulb and infiltrate your home network to spy on your dishwasher.

2015 Commercial Progression Highlights

2015 was an exciting year of developments for Commercial Progression; new clients, website launches, team members, and office locations. Our work with the University of Michigan continued with fresh launches of Drupal websites for the School of Kinesiology, the MCubed 2.0 Funding Portal, and the Ross School of Business. We relaunched the Detroit Zoological Society's website on a responsive Drupal platform and picked up the support and maintenance needs for the National Council of Nonprofits. Dave DeLoria joined Commercial Progression's project management team in Northville and Andy Blanchard left to launch the Grand Rapids Michigan office.

Extra bonus... study up on your Street Fighter (Shoryuken) versioning, there will be a quiz next year as to which characters were featured in the Street Fighter ultimate alpha redux infinity 3 pro edition. Crock pot Thursday recipes, cool external thunderbolt GPU... ok, that's enough.

Hooked on Drupal Content Team


CHRIS KELLER - Developer



Podcast Subscription

Hooked on Drupal, Decoupled Drupal Architecture, Static Site Generators, Internet of Things

Nov 12 2015
Nov 12

[embedded content]

Commercial Progression presents Hooked on Drupal, “Episode 12: Drupal 8 is here, let’s #celebr8d8!". With the official Drupal 8 release date set for November 19th, the CP development crew assembles for an in-depth conversation on all things Drupal 8. We predicted the release date of Drupal 8 to within 3 days on our February podcast.  This time, Hillary Lewandowski will be presenting an overview of Drupal 8 at our next meetup and Drupal 8 release party with Girl Develop It Detroit at Grand Circus. Approaches for migrating Drupal 6 and 7 sites to Drupal 8 are discussed. Changes in the development cycle for Drupal 8 going forward are mused upon. What does it mean that Drupal 8 is built on Symfony and how will the respective development communities merge, we talk it through.

Drupal 8 Release Party: Detroit, Michigan - November 19th

Drupal 8 Release Party: Detroit, Michigan - November 19th

The wait is over, Drupal 8 is here, let's #celebr8d8! Conveniently we had a Drupal meetup scheduled for the same night as the release of Drupal 8 (Thursday November 19th, 2015), so this meetup has just been upgraded to the…

Drupal 8 Release Party: Detroit, USA

Grand Circus has been a gracious host of The Michigan Drupal User Group in 2015.  This has allowed us to meet some of the  members of the Girl Develop It Detroit community and has given rise to this opportunity for co-hosting a demo / training night for all things Drupal.

We know there is a strong development community in Detroit, and we believe this is the season for curiosity in Drupal to bloom.  The full version of Drupal 8 will be released on Nov. 19th.  Now is the time to check it out, and this is the Meetup for you to do it!

Drupal 8 Upgrade and Migration Strategies

With the release of Drupal 8, Drupal 6 website owners are also faced with an imminent deadline for upgrade and migration. Drupal 6 was released in February of 2008.  End-of-life support for Drupal 6 is February 24th 2016.  If you have a Drupal 6 website that needs core support through 2016, now is the time to execute your upgrade to Drupal 7 or Drupal 8.  In this podcast we discuss the options of a Drupal 6 website owner facing this inevitable end of support deadline.

If you have a Drupal 7 website and you are thinking about upgrading to Drupal 8, how do you decide and what should you consider?  We discuss the out of the box User Experience advantages of the Drupal 8 platform with in line editing features as well as some of the object oriented programming advancements of Drupal 8 on Symfony.

Stay tuned for the future release of 50 training videos from OSTraining specifically addressing the upgrade and migration path to Drupal 8 from previous versions of Drupal.

Launching a New Drupal 8 Website

If you are starting a new Drupal web development project, should your default choice be Drupal 8?  Are there some scenarios in which Drupal 7 is still a good candidate for web design and development? Drupal 7 is a mature development platform with long term support secured up to the release of Drupal 9.  This gives Drupal 7 developers and website owners several years of fully supported Drupal 7 development.

Every new Drupal web development project will want to seriously look at Drupal 8 and consider if there is a good reason why they should not take on the project with the latest version of Drupal. The Drupal development community will be very much focused on Drupal 8 and that is where all of the best energy and talent will be working. Going forward, new features and web integration projects will begin with Drupal 8 in mind.

Drupal 8 is Built on Symfony

Our development team has been training up on the Symfony web development framework over the last few years. Dan Reinders has attended several in-person training classes with the folks at KNP Labs, not to mention their online offerings at KNP University. In this podcast, Hillary describes how the move to Symfony shapes the Object Oriented programming future for Drupal 8. Complex website will be able to experience gradual development progress via deprecated function migrations within a predictable software release cycle. This means there will be far fewer hurdles to jump as projects upgrade to new versions of Drupal in the future. This move to Symfony also opens up Drupal development to include a global community of experienced Object Oriented programmers.

Hooked on Drupal Content Team


CHRIS KELLER - Developer



Podcast Subscription

Hooked on Drupal podcast: Drupal 8 release, celebr8D8 upgrade and migration

Jul 29 2015
Jul 29

[embedded content]

Commercial Progression presents Hooked on Drupal, “Episode 10: Summer of Drupal with Special Guests Hillary Lewandowski and Michael Zhang".  In this episode of Hooked on Drupal, the usual crew is joined by two new members to the CP team.  Hillary Lewandowski, the latest member to the development team brings her wisdom from a formal education in computer science.  

Michael Zhang of Northville DECA, the world's happiest intern

Additionally, Michael Zhang is one of two summer interns from Northville High School and an active member of Northville DECA, with a focus on marketing.  Michael also published a personal blog post. In tell-all fashion, Michael describes his experiences interning at Commercial Progression.

Hooked on Drupal is available for RSS syndication here at the Commercial Progression site. Additionally, each episode is available to watch online via our YouTube channel, within the iTunes store, on SoundCloud, and now via Stitcher.

If you would like to participate as a guest or contributor, please email us at

[email protected]

Content Links and Related Information

We experienced this year's DrupalCon vicariously through our last Michigan Drupal meetup and our previous podcast with Steve Burge from OSTraining.  This summer proves to be quite busy with new team members, projects, and Drupal 8 investigations.

As the Commercial Progression team size grows, our development team has begun to specialize.  Brad has focused on developing new processes for site architecture and shares his discoveries for preparing a Drupal project for design and development. Other team members share their personal project subject matter.

OOP In Drupal 8

In addition to working with the new WYSIWYG Fields and Conditional Fields,  Hillary shares some of her thoughts and computer science background with Object Oriented Programming and Drupal 8 in her latest blog post.

Personalize Module

Chris and Shane discuss the Acquia contrib Personalize module based on Lift technology for content personalization via URL based campaign parameters, geography, visitor cookies, A/B or Multi-variate testing, and a host of other variable session data.

Paragraphs Module

Inspired by Jeff Eaton and the Battle for the Body Field DrupalCon presentation, Brad dug into the Paragraphs module and put together a popular paragraphs blog post with some best practices for winning the battle for the body field.  When Brad is not fighting the good fight for the supremacy of the Paragraphs module, he has also created an automated competitive marketing intelligence research script… yeah I know, really.

Hooked on Drupal Content Team


CHRIS KELLER - Developer




Podcast Subscription

Michigan Drupal Developer podcast

Jul 16 2015
Jul 16

Have you ever wanted to create a page on your Drupal 7 website and send it over to a friend or group of people… but you don’t want the general public to see it? You could always set it up so they just log in, but that’s an extra step and not all of the people you want to send this to have user accounts on your site.

If this sounds like you then the Token Content Access Module is just what you need. The Token Content Access Module makes it easy to hide a page and require a unique key to be added to the URL to gain access. This means you can create content, hide it from those pesky anonymous users, and drop that hidden link directly into an email campaign to ensure only subscribers will see the page.

Configuration on this module is simple. Just turn the module on, edit the content type settings, and finally edit the page. That’s really all there is to it.

Jun 24 2015
Jun 24

If you are just getting started with Drupal and are looking for some help on learning Drupal 7. You have come to the right place.

In this simple Drupal tutorial, I will highlight some resources for getting started, provide you some Drupal basics, and then if you are interested, you can sign up for Code Karate's 30 Day Drupal Email series (using the form at the bottom of this post). The email series breaks the entire Drupal 7 learning process into manageable chunks spread out over 30 days. In fact, the Drupal tutorial below is just a simplified version of what you will get in your inbox.

Drupal introduction

First, you might be wondering... "what is Drupal and why should I use it?"

Well, in it's simplest terms, Drupal is an open source content management system (CMS) that can be used to build all different types of websites from simple to very complex. Drupal allows you to create a website and manage all your content, media (images & video), users, and so much more. Drupal is much more than this, but hopefully that gets you pointed in the right direction. Drupal will help you build awesome and extremely flexible websites... that's the best simple definition I can think of.

Now you are ready to learn about some available Drupal learning resources. The link below will take you to a link that discusses some of the various ways to learn Drupal.

Best Way to Learn Drupal

If you are ready to get started right now. Read the following two sections to learn how to get Drupal installed and how to start managing your content in Drupal. If you get stuck or need additional help, don't hesitate to contact me.

Installing Drupal


  • Learn about the different methods for installing a Drupal 7 website
  • Learn how to get a Drupal website installed

There are many different ways to install Drupal. These different ways depend on how you want to develop your site and what type of computer you are using. The first question you need to ask yourself is if you want to develop your Drupal website locally (directly on your computer) or if you want to use a third-party service for developing your Drupal site. You will learn about each of these different options.

Installing Locally

The most common way to get started is to install your first Drupal 7 website directly on your computer. In order to do that, you will need to install some programs to get your own personal web server set up. The setup varies depending on what type of operating system you are using. In the following sections, you will find resources for getting Drupal installed locally for a variety of different operating system.

Installing on Linux

You might wonder why Linux is the first on this list. Well.. perhaps I am a little biased. Either way, below you will find a link that will walk you through how to get a local development environment set up on an Ubuntu Linux operating system. Other flavors of Linux are similar, but may vary a little.

Installing using Acquia Dev Desktop

If you are running Windows or Mac and want a more streamlined option, I would recommend using Acquia Dev Desktop. It provides a simple and seamless experience.

Installing on Mac

Macs are also popular options for developing with Drupal. If you have ever attended a DrupalCon, Drupal Camp, or other Drupal-related event, you will undoubtedly have seen an abundance of Apple logos in every session. Installing Drupal on a Mac is pretty straightforward, just follow the videos below to get your own MAMP server set up. MAMP stands for Mac (the operating system), Apache (the web server), MySQL (the database), and PHP (the programming language).

Installing on Windows

If you are using windows, you will want to install either WAMP (Windows, Apache, MySQL, PHP), or XAMPP. You will find links below for both options.

Installing using Vagrant

Vagrant is a tool that allows you to build an easy to reproduce development environment. This means you will have a consistent development environment that you can rebuild, reconfigure, and essentially destroy as needed. It’s a tool that I along with many other seasoned Drupal developers use. If you are just getting started with Drupal, and you are not a well versed server administrator, you might want to come back to this later. If you do want to check it out, the link below can start pointing you in the right direction.

Installing on an external platform

There are other third party platforms you can use to develop your Drupal website. Some of these are built directly for developing Drupal websites, and others are built to support a variety of other platforms, but still allow you to develop a Drupal site.

Here are some services that provide development environments specifically tuned for Drupal. Feel free to sign up to either of these for free to try them out. They have pretty straight forward documentation on how to create your first Drupal site.

Here are some more general Drupal hosting services that CAN serve as a development environment. I would recommend using the other above options if possible to develop your Drupal site, and keep the options below for when you are ready to launch your site live.

Wrapping up the Install

As you can see there are many options to install Drupal. Unfortunately there is no one right way. It all depends on what you are looking for. If you are in a bind and don’t know what to do, I would suggest trying Acquia Dev Desktop first, and going from there.

Managing Content


  • Learn how to add, edit, and delete content on your Drupal site
  • Learn how to use the content administration page

First, look through the following two articles from Drupal.org:

Now, complete the following steps on your own to try out what you just learned:

  • Create your first few pieces of content on your Drupal site. These could be pages or articles but make sure you have at least one article.
  • Make sure you can find, filter, and edit the content from the Content Administration page
  • View your homepage to see a list of articles you have created. Notice that if you click on the title of the article you get to the full node page. From this page, you will see tabs at the top for viewing and editing the individual node.

Content Management Summary

You have now learned how to add, edit and delete content from your site. Make sure to spend some time trying out the available configuration options when creating content to get a feel for what they all do.

Getting Started with Drupal Summary

You now know how to install Drupal and how to manage content inside of Drupal, but you still have a lot to learn. These first few steps are only the beginning. If you want to continue learning more about Drupal, you can enter your email below to receive an email a day teaching you more about Drupal for the next 30 days. If you want to continue learning right now and don't want to wait 30 days, take a look at Code Karate's Learn Drupal in 30 days eBook.

Good luck on your Drupal journey!

Jun 19 2015
Jun 19

Drush... what a wonderful web you weave. My guess is you have probably heard about this mysterious thing known as "Drush" and are looking to find out:

  1. What exactly is Drush?
  2. Is Drush something that will be useful for me?

The first one is an easy one. Drush is short for Drupal Shell and is a command line tool that makes interacting with your Drupal website a breeze.

The second question is also easy, but first I have a question for you. Do you use Drupal? If the answer is yes... then Drush will probably be useful for you.

Drush: An Introduction

You might be thinking to yourself about now... "but I don't spend hours of my day behind a command prompt". In fact, you might be a little nervous about even having to open a command line window. Don't worry... we will try to take it slow.

I'm convinced that if you do even a modest amount of Drupal development, spending just one hour learning how to use the command line and Drush commands will save you countless hours of time. In the next few sections, I am going to show you how Drush can be used to automate and simplify a lot of common Drupal administrative tasks.

Getting used to the command line

If the command line scares you... don't worry, you are not alone. At one point many years ago I was thinking the same thing... "why can't there just be a nice GUI for this?" If you spend a little time learning though, you will quickly find out that it's not as bad as it seems and it can save you a lot of time.

If you are not familiar at all with the command line, below you will find a quick tutorial that will help you get started. If you are already familiar with using the command line, you can skip this section.

Special Note for Windows Users: Sometimes it's tough to be a Windows developer... This is also true if you want the best experience using Drush. You "technically" don't need to install any additional programs to get started, but I would recommend installing Msysgit and getting it to work with Drush. This tool will provide a much better and more powerful command line experience. Msysgit will allow you to use a Bash shell (just like your Linux and Mac friends).

Opening up the terminal

It's now time to open up the terminal. If you are using Windows, open up your shiny new Msysgit program. If you are using Mac OSX, open up your Finder, select Applications, then Utilities, and find Terminal.

Oh... If you are using a flavor of Linux (like I am as I write this)... wait who am I kidding. You already know how to use the Terminal... go ahead and skip this section!

Some basic commands

Don't be intimidated by the contents of the terminal window (or the lack thereof). Simply get started by typing in a simple command. Go ahead and type:


Then hit Enter.

You should now see a list of the files in the current directory. This is no different than browsing your files on your file system. Now try:


This command stands for "print working directory" and will print out in the terminal your current location. The next step is navigating, you can do this using the cd command. Go ahead and run the following command:

cd ..

This tells your terminal to "change directory". The .. tells the terminal to go up one folder. You can use the pwd command to see your current location.

If you want to go back into the folder you just navigated out of, try this:

cd [folder-name]

Replace [folder-name] with the name of the folder you want to navigate into. Note: Once you start typing the folder name, you can hit tab to auto-complete the name for you. You will use the tab key often when you are using the Terminal to save you time.

Those are the basics, but there is a lot more to learn. Here are some other commands you might want to try out.

Command What it does cd This command on its own will return you to your home folder (where you started when you opened up the Terminal) touch [file-name] Create a new empty file called [file-name]. Example: touch test.txt mkdir [folder-name] Create a new folder. Example: mkdir myfolder cp [file-name] [new-file] Create a copy of [file-name] and call it [new-file]. Example: cp test.txt backup.txt mv [file] [new-location] Moves a file to a new location. Example: mv backup.txt ../ This will move backup.txt up one folder level. rm [file-name] Deletes the file [file-name]. Example: rm test.txt

Drush: Getting things Installed

The first step is to get Drush installed. Installing Drush is not an overly complicated process, but because it varies depending on the operating system your website runs on, and if you are running the site locally or on a remote server, I won’t go through all of the installation possibilities here.

There is a page on Drupal.org that provides information depending on the type of platform you are installing Drush on. Typically you need to install Drush on the server that is hosting your Drupal website (you can get around this with something called Drush aliases, however, we won’t be covering that topic). For the installation instructions, go to https://drupal.org/node/1791676.

Drush: Downloading and Installing Modules

We are now ready to begin installing some Drupal modules and themes on our new Drupal website. I am going to start with one simple example. Downloading and installing the module_filter module.

Drush Command What does it do? drush dl [project-name] Downloads a Drupal module or theme. The name can be grabbed from the drupal.org project name. For example in https://drupal.org/project/module_filter the project name is module_filter drush en [module-name] Installs a Drupal module. Keep in mind when you download a Drupal module, it may contain multiple modules. You can get the correct module name from the output of the drush dl command.

The first step is to download the module_filter module using the drush dl command:

This command will tell you where the module was downloaded (in this case sites/all/modules/module_filter) and if there are multiple modules that can be enabled/installed.

Now we install/enable the module using the drush en command.

You can also use the drush en command to download and enable multiple modules at a time. Just put a space between each module name when running the command.

Drush: Disabling and uninstalling Modules

There may come a time where you need to disable a Drupal module. If this is the case, you can do so with the drush dis command. You can then uninstall a disabled module with the drush pm-uninstall command.

Drush Command What does it do? drush dis [module-name] Disables a Drupal module. drush pm-uninstall [module-name] Uninstalls a Drupal module.

If you were launching your website and you no longer needed the views_ui module, you can disable the module using drush dis views_ui.

A Drupal module can be disabled, but that does not necessarily mean it is uninstalled. A Drupal module may create additional database tables in your Drupal database or add additional variables to your Drupal variables database table. If you disable the module, those database tables and variables will not be deleted. This means you are able to enable the module later without losing any of your module settings.

The drush pm-uninstall command will completely uninstall your module removing any database tables and variables that the module has stored.

Here we run the drush pm-uninstall views_ui command to uninstall the Views UI module that we previously disabled.

Drush: Running cron and clearing cache

Now you will learn how to use drush to run cron and clear the cache on your Drupal site.

Drush Command What does it do? drush cron Runs Drupal cron process. drush cc Clear the Drupal cache. drush cc all Clear all of the available Drupal caches.

You can manually run the Drupal cron process using Drush by running the drush cron command.

You can clear the Drupal cache using the drush cc command. After running this command, Drush will provide you an option to select which cache you want to clear. In this example we select 1 to clear all of the available Drupal caches.

You can also specify which Drupal cache to clear directly in the drush cc command. In this example we run drush cc all too clear all of the Drupal caches without the extra prompt to choose the Drupal cache to clear.

Additional Drush Commands

Here are some additional Drush commands you might want to try out:

Drush Command What does it do? drush archive-backup Backs up the code, files, and database of a Drupal website. drush archive-restore [backup-path] Restores a Drupal website to a previously backed up state. drush up Updates the modules, themes, and core Drupal code on your Drupal website. This command will also perform any necessary database updates.

Drush Wrap-up

There is a lot more you can do with Drush. You can always get a list of commands by running drush help. You can also use the helpful website drushcommands.com. If you want a helpful Drush cheatsheet, enter your email in the box at the bottom of this page and I will send you mine! I will also send you some additional Drush commands and getting started ideas.

Jun 07 2015
Jun 07

What if you had to go build a Drupal site on a remote island without WiFI? Yes that's right, no internet connection at all? What modules would you bring with you?

For some random reason, I posed this question to myself and came up with these 4 modules. Because I believe these modules can be used to build a multitude of complex Drupal sites, I think of these modules as the "Ultimate Site Builders Toolkit". Become an expert in these modules and you will be able to build some wicked awesome and complex Drupal 7 sites.

Module #1: Views

The Views module was, of course, my first choice. How can it not be? I use this module in every Drupal 7 website I build. Most people know that the Views module is great for creating lists of content. However, not everyone knows the intricacies and complexities of views. Once you start learning about relationships, contextual filters, and aggregation, it opens up a whole new world of possibilities.

If you are going to build a complex Drupal website on a remote island... you are going to want to take Views with you.

Module #2: Panels

This one will be the most controversial. After all, everyone has their site building layout tool of choice. For some, it might be Display Suite, Context, or some other Drupal module... but for me, it's Panels hands down, without a doubt. I know it can be a little heavy-handed at times, but it's packed with a plethora of features that make any site builders worst layout nightmare a breeze.

If you are just getting started with Panels it can seem a little intimidating at first. There are so many things you can do with the module. Once you master the basics and start understanding contexts, relationships, variants, and visibility rules, the options really start to open up. If you know what these are and how they are used, you can master almost any layout with ease.

I am packing the Panels module in my suitcase when I head for that remote island. Quick question... does this remote island have a nice beach? I sure hope so...

Module #3: Rules

When you say to yourself, "when this happens, then I want to do this" that is usually a solid foundation for a rule. Rules can do so much that sometimes the true test is to learn when to not use them. I can't tell you how many developers have contacted me asking me to help them get the rules module to do something that could easily be accomplished with views, panels, and entity references.

If you do master Drupal rules, you can accomplish some pretty awesome things.

Remote island... Check. Rules module... Check. What to do when my laptop battery runs out.... Unknown.

Module #4: Entity Reference

Used correctly, the entity reference module allows you to build complex and interconnected data structures. This one module helps turn Drupal into a content and data modeling tool. You might be wondering what is so great about relating content with entity reference? Well, content doesn't live on an island (even though I am on one in this figurative thought exercise). This means content is connected to other entities (nodes, users, etc) on your site in sometimes complex ways. The Entity Reference module makes this possible.

The Ultimate Site Builders Toolkit Summary

Arming yourself with great working knowledge of these modules will make you absolutely lethal when it comes to completing complex website requirements. Did I mention you can do this without having to write a single line of PHP code?

How do you rate yourself on knowledge with these modules? If you want to become a better Drupal site builder (without having to write code), then leveling up your skills with these modules is one of the best ways to spend your time.

It's your turn to take the #IslandOfDrupal Test

So now I pose the question to you, if you had to go build a Drupal site on a remote island without WiFI, what modules would you take with you?

Go ahead and take the #IslandOfDrupal test yourself and post your answer in the comments below (and try to keep the number of modules below 5)... This should be interesting!

Also, please share this post with others in the Drupal world.

May 22 2015
May 22

[embedded content]

Commercial Progression presents Hooked on Drupal, “Episode 9: DrupalCon LA 2015 Highlights with Steve Burge from OSTraining".  In this special DrupalCon edition of Hooked on Drupal we conferenced in Steve Burge of OSTraining for an on the ground report from Los Angeles.  Held on May 11-15, 2015 DrupalCon LA was the premiere event for the Drupal community.  Steve brings us the inside scoop of highlights and takeaways as the conference wraps up.  Additionally, Alex Fisher (also a DrupalCon veteran) shares his memories and insights from past DrupalCons.  Commercial Progression has recently sponsored OSTraining with a $5000 kickstarter backing to bring Drupal 8 upgrade training to the masses.  This new collection of video resources will be released in September 2015.  With Dries call to support Drupal as public utility from DrupalCon, this announcement seems especially timely.

Hooked on Drupal is available for RSS syndication here at the Commercial Progression site. Additionally, each episode is available to watch online via our YouTube channel, within the iTunes store, on SoundCloud, and now via Stitcher.

If you would like to participate as a guest or contributor, please email us at

[email protected]


Content Links and Related Information

OSTraining logo


Hooked on Drupal Content Team

ALEX FISHER - Founder of Commercial Progression

STEVE BURGE - Founder of OSTraining

Alex Fisher Steve

Left, Alex Fisher, founder and owner of Commercial Progression in Northville, Mich.
Right, Steve Burge of Sarasota, Fla., founder and CEO of OSTraining

Podcast Subscription

Hooked on Drupal Episode 9 - DrupalCon 2015 Review with Steve Burge of OSTraining Podcast

May 10 2015
May 10

Taking a content type and displaying it in a Drupal View is core to any Drupal website. If you are new to views, you can check out our Drupal views video. As you venture into views you will learn hundreds of ways to manipulate content to change the way the end user is able to interact with the content. To help enhance this, you can use the Views Isotope module. This module uses the jQuery isotope library to dynamically filter views content. As the title states, it’s pretty fancy.

To get an idea of what the library does visit the website for the library at http://isotope.metafizzy.co.

jQuery Views Isotope Module: https://www.drupal.org/project/views_isotope
jQuery Views Isotope Library: http://isotope.metafizzy.co/

May 01 2015
May 01

Sometimes you have a situations where your normal Drupal administration menu just won’t cut it. Maybe you have someone that needs to perform some administrative tasks on your site such as managing content and comments, or perhaps something more complex such as managing the Drupal blocks. This person might be a technical wizard, but there is also a good chance that they might not be. In fact, they might be the person in the office that calls you when their “computer is broke”.

If this is the case, then the Administration Menu Source module might be your saving grace. This module works with the Admin Menu module to allow you to specific different menus for the different user roles of your website. This makes it really easy to fine tune the usability of your site’s administration navigation to cater to specific types of users.

If you have multiple types of administrative roles that perform admin or managerial tasks on your Drupal site, go ahead and give this module a try. It’s easy to set up and will make things a little easier to find for everybody involved.

Note: Make sure to give the correct roles the "Access administration menu" permission so they can view the admin menu.

Apr 17 2015
Apr 17

In this episode we cover an overview of the Drupal 7 Views module. The Drupal Views module is probably the most popular Drupal module and is installed on almost every Drupal 7 website I build. It’s so popular in fact that it’s included in Drupal 8 by default.

The Views module allows you to easily build and format lists of content on your Drupal 7 site. If you need to build a simple list of Nodes, Views can do that. If you need to build a table listing, Views can do that too. In this video, we will go through an introduction and overview of Views, as well as a few example views. You will learn about the different types of content you can display with Views, different display settings, and other Views options.

This video is built to be an introduction for beginners and newcomers to Drupal to teach the basics of the Drupal 7 Views module. In this video you will create two views. The first will be a page view that displays a list of articles on your Drupal website. The second will be a block view that shows the titles of the last three articles on your Drupal website. Using the skills you learn in this video, you will be ready to tackle more complicated problems that can be solved with views.

Now go out and build yourself some views!

Apr 09 2015
Apr 09

If you are building out a Drupal 7 site you may some day run into a situation where you need to have more dynamic options for a field attached to a content type (or any other type of entity). If the default allowed values text area will not work for your situation, then you have come to the right place. In this tutorial, we will discuss two different ways to create a more dynamic options list for extending your allowed values.

Method 1: Entity Reference

The first and most common reason you will need a dynamic options list is to reference some other type of entity or content on your site. This is easily manageable through the Entity Reference module. You can use the Entity Reference module to create a field to reference to any other type of entity. I have many other posts/videos on the Entity Reference module so I won't spend much time on it, but it's a great module for any Drupal site builder to become familiar with. I use it on almost every complex Drupal site I work on.

Method 2: Change the allowed values function of your field

The method requires a little module development/PHP skills. This is useful if you need to pull in your options value from some other database table (maybe a custom built one or one created by a contrib module).

In order to easily follow along with this you will need to be using the Features module to export your field to a Feature module. I have many posts/videos on the Features module and an entire section of my 5 secrets ebook that covers how to use Features on your Drupal websites.

So the first step is to create your Feature module making sure to select the field that you want to create dynamic options for. Once that is finished you will have to make changes to some of the exported Feature module code.

What! Change the Feature module code?

You might be thinking "It doesn't seem like a good idea to change the code generated by the Features module". You would be 100% correct in this thinking. It's typically not a good idea to change the code of a Feature module. However, the Features module does a pretty good job maintaining custom changes you make (depending on where you make the changes).

For instance, I commonly use the .module file generated by the Features module to add simple helper functions or form alter functions that are directly related to the exported Feature module. This allows me to keep the related code with the related Feature. I have seen a lot of developers create a Feature module and a custom module for the related code. While this typically works OK the main problem with this is that now you have a custom module that depends on the Feature module, and the Feature module that might depend on the code of your custom module. This gives you a strange circular dependency situation. To avoid this, just add your code to the module file (just don't remove the includes line of code at the top). Trust me... it's safe to do this and sometimes it makes a lot of sense.

To change the allowed values of a field, you will need to find the file that was created and ends with .features.field_base.inc. So if your module is called my_feature_module you will need to open my_feature_module.features.field_base.inc.

Search the file for the field you created and whose options you want to control. It should look something like this:

// Exported field_base: 'field_my_feature_module_options'
$field_bases['field_my_feature_module_options'] = array(
  'active' => 1,
  'cardinality' => 1,
  'deleted' => 0,
  'entity_types' => array(),
  'field_name' => 'field_my_feature_module_options',
  'locked' => 0,
  'module' => 'list',
  'settings' => array(
    'allowed_values' => array(),
    'allowed_values_function' => '',
  'translatable' => 0,
  'type' => 'list_text',

You will notice there is an allowed_values_function element in the array. In this case, you will want to change that to a PHP function that you will need to create. So in this case we are going to create a function called _my_feature_module_options_list (this could be any function name you want). Also make sure your allowed_values element is set to an empty array.

'settings' => array(
  'allowed_values' => array(),
  'allowed_values_function' => '_my_feature_module_options_list',

You are now ready to create your function. Simply open up your .module file (in this case it would be the my_feature_module.module file) and add your function. If you want to create static values, your function will look like this:

function _my_feature_module_options_list() {
  return array(
    'option1' => t('Option 1'),
    'option2' => t('Option 2'),
    'option3' => t('Option 3'),
    'option4' => t('Option 4'),

If you wanted to pull values from a database table it might look something like this:

function _my_feature_module_options_list() {
  $results = db_query("SELECT value, label FROM {my_custom_table}");
  $options = array();
  foreach ($results AS $result) {
    $options[$result->value] = t($result->label);
  return $options;

In order to get this to work you will need to make sure your Feature module is enabled on your site and ensure it gets reverted back to the default state. Once you do this, your values should be dynamically created by your custom PHP function.

Summing up using the allowed values function

From my experience, I have never had an issue with the Features module overwriting my allowed_values_function setting. It's a pretty rare situation where you will need this as most use cases are covered by either a static allowed values list or can be handled by the Entity Reference module. If you do find yourself needing a dynamic list of options controlled by a PHP function, then the method presented above provides an easy solution.

So go ahead and make those allowed values dynamic and let me know what you think.

Mar 29 2015
Mar 29

In the last episode, we learned about the Drupal Subuser module. In this episode, we continue where we left off but take a look under the hood at the module code of the Drupal Subuser module.

By following along with this episode you will learn some things such as:

  • How to open up a Drupal module file and what to expect
  • How to find and locate an issue within a Drupal module file
  • How modules modify forms with hook_form_alter()
  • How to debug PHP variables in a Drupal module
  • How to test our fix to ensure it works correctly

If you have never seen a Drupal module before this might be a little intimidating and I might go a little fast, but you will still learn a lot. You should be able to start seeing patterns within different Drupal modules on how modules are structured. Good luck and happy module investigating!

Mar 23 2015
Mar 23

[embedded content]

Commercial Progression presents Hooked on Drupal, “Episode 7: Dreisy-Wan Kenobi You're our only hope!".  In this latest installment, lead developers Brad Czerniak and Chris Keller are given a mysterious droid with a message from "Dreisy-Wan Kenobi" concerning the future release date of Drupal 8.  After a brief moment of reminiscing about the highlights of DrupalCamp Michigan, Brad and Chris muse about the cryptic messages that seem to predict when Drupal 8 will launch, what the fate of the Backdrop CMS will be, and what Acquia Lift actually is.  Tune in for cosmic revelations from beyond time and space.

Hooked on Drupal is available for RSS syndication here at the Commercial Progression site. Additionally, each episode is available to watch online via our YouTube channel, within the iTunes store, on SoundCloud, and now via Stitcher.

If you would like to participate as a guest or contributor, please email us at

[email protected]


Content Links and Related Information

Hooked on Drupal Content Team

BRAD CZERNIAK - Developer Talent

CHRIS KELLER - Developer Talent



Podcast Subscription

Hooked on Drupal Episode 7 - PREDICTIONS ON THE FUTURE OF DRUPAL from Dreisy-Wan Kenobi, You're our only hope.

Mar 19 2015
Mar 19

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on episode number 198. And today we’re going to be going over the Sub-User Module. The Sub-User Module allows you to create a user and then have that user be able to create users underneath themselves so you could have and what our example is going to be is a manager user that can create a content reviewers underneath them and then you can give them permissions to control, if they can edit or delete those sub-users and you can do all kinds of cool things.

So we’re going to be going over that today, but before we get started make sure to follow me on Twitter at smthomas3 if you haven’t already and check out codekarate.com. Make sure you’ll get some of the other videos and posts and you can learn a lot about Drupal and click this little link over here for the free sticker giveaway if you haven’t already and we will send you a Code Karate sticker right to your door. So let’s go ahead and get started.

We have our development site here that we will be working on and I’m going to go ahead and turn on the sub-user modules. The two we’re going to be going on today are just the sub-user and the sub-user UI. The Sub-User Switch Module allows you to switch to a sub-user or login as a sub-user. We won’t be going over that one. You can see I’m using the dev version, you shouldn’t have to use the dev version, but I was doing some testing. It does require the relation module so you’ll need to have that downloaded and installed in order for this to work.

So we’re going to go ahead and install this. And the next step, once these are installed, is to go to the permissions page and set permissions for the sub-user module. So I’m going to go ahead and sort this just for Sub-User permissions. And you can see we have a list of permissions here. The important one that you need to have is to allow them to create enough authenticated user. So in this case you can see I have a manager role and a reviewer role. Well what I would like to do is to allow the manager to create other accounts and possibly give those accounts a reviewer role so that I could either create just authenticated users or an actual authenticated user with reviewer role.

So in order to do that I need to make sure they have the manager account or manager role has create an authenticated permission check. I’m also going to give it create a reviewer permission. So let’s save that and what we will do is we will go ahead and create an account called Manager Quick and we will give it the manager role and in this case you’ll notice there’s a field, it’s user relations, so the store relationship that will allow for the management of the user. So I’ll go ahead and allow that. And just to check, you’ll notice that when you come to your account page, when I click over here there’s a sub-users option here. Under Sub-Users, I now have this manager option. So now this manager is technically a sub-user of Code Karate. And so if I edit this, you can see that it’s just like a normal edit page, there’s a sub-user limit.

We will go ahead and login as this manager. And you’ll notice if we go to your My Account page as the manager you’ll see sub-users here. It says the user currently doesn’t have any sub-users which make sense, but you can add a user. So if we click add you get the normal or what looks like the normal user add form. You’ll notice one difference, you don’t see any role selection and I’ll explain why in a second. That’s actually something that should be there, but it’s not showing up currently.

But let’s go ahead and create a reviewer. Okay so now a reviewer has been created. If I come back to my account page and go to sub-users I can see that reviewer one has been created. I don’t have any access to edit this user and currently the user only has the authenticated user role so obviously this isn’t right. So what we can do is let’s come back to our admin side and let’s go back to the permissions page. And let’s give the manager permission to edit sub-users and delete sub-users. So we will go ahead and save that and now if we come back our manager account and we refresh the page, you’ll see I now have Edit and Delete links.

So if I edit this user you will notice the role option does show up and it only shows those roles that I have permission to create for. So I can give them the reviewer role now. I can save that, and now when I come to the sub-users page you’re going to see they have the authenticated and reviewer role. So you might be wondering why you can’t select the actual role when you’re creating the account and there’s actually a bug out here on drupal.org which hopefully…by the time you’re watching this might already be fixed.

If it’s not you can see there’s a solution here and in the next video I’m actually going to show you not using necessarily this solution but how you could debug this and fix it on your own so we’ll get into a little module development and you’ll look at the details of the sub-user module and figure out how you could fix this to kind of work. And then of course you could have posted this issue yourself but we’ll go through that in the next video. But you’ll see what the sub-user module does is it allows you to really create a hierarchy of users of I guess relationships between users.

So, in this case, the manager is the sub-user of the Code Karate account but it also has sub-users of its own. So a manager could then manage multiple reviewers, manage their accounts on their site and they could be in charge of possibly reviewing content. They would only have the permissions that a reviewer would have. Make sure you’re careful of course when you’re giving out these permissions because these…whatever roles you allow to create accounts, they can possibly do things that could harm your site so you want to be very careful with the permissions. You, for example probably don’t want managers being able to create administrators.

So just keep that mind, it’s a really simple to use module, besides that one bug it seems to work really smooth and it allows you to go ahead and create all different kinds of user hierarchies on your site which can be really good especially if you have a lot of content and you want people to review it or you’re creating some kind of social networking site. I can see a lot of users for it.

So go ahead and give the sub-user module a try, make sure to check out codekarate.com, check the next video if you’re interested in learning a little bit of module development on how you could debug the problem that we found earlier on not being to actually select the role when you’re creating the account.
So we’ll do a little module investigation in the next episode. But that’s it for this time, make sure you get your free Code Karate sticker and I will see you next time. Goodbye!

Mar 13 2015
Mar 13

I recently received an email from someone who finished reading the 5 Secrets to Becoming a Drupal Ninja eBook. The question was how to set up Git for an already existing Drupal website. The question is a great one because almost everyone that uses Git now had this question at some point.

In this post, we will walk through a few options for how to go about setting up Git on an existing site with multiple Drupal environments (Development and Live). We will also assume that there might be changes on the Dev environment that have not been pushed up to Live yet. We will also assume initially that we will just use a single master Git branch.

If you want to learn more about Git, you can start with An introduction to Git (part 1).

Before you start: Figure out your workflow

Before you go ahead and try to get Git set up, you will want to take a little time to ensure you know how you want your workflow to work. These will vary depending on how your Drupal environments are set up, how many environments you have, and how many developers you might have working on the project. In this case, let's assume this is a relatively simple setup. Just a Development and Live environment with only a small number of developers.

In this case we will want Git installed on the server hosting the Live site as well as the server running the development environment (Note: This could be the developer's own computer). If we walk through the path of a simple new addition to the site, if might look like this:

  1. Changes are made on the development site
  2. Changes are added to Git (using the git add and git commit commands)
  3. Changes are pushed up to a third party Git hosting service (Github, Bitbucket, etc).
  4. On the live site the changes are pulled down (using the git pull command)
  5. If the new functionality changed the database, then the database update script is run (either through the drush updatedb command or through the Drupal /update.php page).
  6. If there are new modules that need to be turned on, they are turned on using the drush en command or by the Drupal Module Admin page.

Your workflow could have more steps than this, but this should give you the idea. By thinking about how code moves through the process initially, you will have a better grasp on how things need to be set up.

This is also a good time to go ahead and set up a new Git repository in your third party Git hosting service. When setting up your new Git repository using one of these services they will often give you the Git commands you will need to run for an existing project.

Git Setup on Existing Site

Note: Make sure you have adequate backups of your Live and Dev sites before getting started... just in case.

If you want Git set up now on all your environments and your Dev environment is not currently ready to go Live, then you will want to start on the Live environment. If you have command line access to the server, and this is a Linux server, you may be able to do this directly on the live server.

Inside the folder for your live Drupal site run the following commands (or the ones that your Git hosting service tells you to... they should be similar). Make sure to replace [git-remote-path] with the path to your hosted Git repository:

git init
git remote add origin [git-remote-path]
git add .
git commit -m "Initial Git commit for my Drupal site"
git push -u origin master

If you refresh the page on your Git hosting service, you should see the master branch with all of the code from your Drupal site. You are now ready to set up Git for your development environment.

In your development environment, I would start by renaming the project folder. If your project folder was currently called drupal7 and was in the /var/www directory on your server, then something like this would work:

mv /var/www/drupal7 /var/www/drupal7_backup

This renames the drupal7 directory to drupal7_backup. You are now ready to clone your Live Git repository:

cd /var/www
git clone [git-remote-path] drupal7

This will clone your live Git repository into a directory called drupal7. If you are following best practices on your development site, the only things that should have changed would all be located in the sites/all folder. If this is the case, then you can simply replace the current sites/all folder in your directory with the one from your drupal7_backup.

rm -r /var/www/drupal7/sites/all
cp -r /var/www/drupal7_backup/sites/all /var/www/drupal7/sites

Also keep in mind that your settings.php file (located in sites/default folder) might need to be copied from your drupal7_backup folder as well.

cp /var/www/drupal7_backup/sites/default/settings.php /var/www/drupal7/sites/default/settings.php

You are now ready to add and commit these changes to your Git repository.

cd /var/www/drupal7
git add .
git commit -m "Adding new features from development"
git push origin master

To pull these changes down to the live environment, just navigate to the project folder and run:

git pull

To pull down any code changes from development (then proceed through the other update steps mentioned above).

Git Wrap-up

That's it. There is really not much to it. From now on, anytime you make changes in your development environment you will follow your predetermined workflow. You will easily be able to view changes to your project code over time and sleep easier at night knowing you have the warm embrace of version control on your project.

Happy Drupal development! Let me know what you think in the comments below.

Mar 08 2015
Mar 08

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on episode number 196. Today we’re going to be doing something a little bit different than normal. We’re not just looking at a specific module but we’re going to look at how to build what I guess I’ve been calling kind of a dynamic display block with mini panels.

So you might want a little familiarity with panels if you’re going to follow along but you should be able to keep up even if you don’t have too much experience. So what we’re going to do, first I’m going to show you what I mean by dynamic display. So on the Code Karate site if you go to a Drupal Commerce related post if it’s tag with Drupal Commerce and you scroll down to the bottom you will see a block here that says we received our free collection of Drupal Commerce videos. If you go to a Git tag or I guess technically a version control tag post, you will see a completely different block here.

Just getting started with Git block and so what we really built is a way to base on the taxonomy term of the post, choose what kind of block or which block we want to display here and it’s just using panels so there’s probably ways you can do it especially if you wanted to spend a little time with some code you can do it more efficiently but it’s still a pretty easy way to create this without using any code at all. So make sure you’d have the panels module downloaded on your site and I’ll go ahead and get started with how to create this.

But before we do, make sure to check out codekarate.com. We have a whole bunch of things changing all the time on the site so you can check out the EBook, check out the Drupal Commerce course and just let us know if you see anything that you think we should do videos on the future. So I have our test site here and I’m going to go to the modules page and show that Panels and Mini-Panels are enabled so you can see mini-panels on and panels are also on. And if you go to our homepage there’s two articles here. This one is a test article and you can see it’s tagged with test and this one is called inspiring quotes and it’s tagged with the tag inspire.

So what we’re going to build is we’ll just build a mini-panel that will display something different depending on which post we click on depending on the tag. And we can go ahead and we’ll be able to put that block anywhere whether it’s on the sidebar, whether it’s below the post. You could actually put it within the post itself if you wanted to really did use panels. One thing to keep in mind when you’re doing this is you want to test this especially with caching because your page is completely cached. There are some things depending on tags so I just want to keep that in mind. Just test it beforehand but you should be okay to follow along with this.

So let’s go ahead to structure mini-panels and we’re going to create our first mini-panels. Let’s just call this Dynamic Display, we’ll leave everything else blank and hit Continue. We’ll then want to make sure we have a required context of node because we’re going to want them on a node page and you can leave the identifier and keyword, just set the defaults and hit Continue. For the layout it’s going to be a really simple layout so I’m just going to go to a single column.

You could make it as complex as you want but I’m going to keep it very simple. I’m just going to display one little piece of text depending on what type of article they’re on. So now we have our mini-panels or I guess similar to panels but editor where you can add content. So we’re going to first add a piece of content and I’m just going to use custom content here but you could use all different types of things. You could put other blocks in here, you could put comment form, you could do anything else that you could normally do with mini-panels or panels and add it into this actual mini-panel to display dynamically but I’m just going to go ahead and use custom content.

So I’ll do one, this one is going to be for…if the keyword or the tag is inspire so I’m just saying do you like inspirational post and I’ll click finish and then I’m going to add another one for that test tag and just say do you like post with the test tag. Just keep in mind that this is a really simple example but you can use it to put anything you want in here. So I’m going to go ahead and just finish this for now and let’s go ahead and look or add it to the sidebar and then we’ll look at how it looks just right now. So if we go down here and find mini-dynamic display, I’m going to put this in the sidebar first column just at the bottom and click Save.

I’m also going to come in here and configure it and only display it on article content types. You could of course determine how you want to do this and you might say, couldn’t we just use two different blocks and for this specific example you can’t because you can’t do it just based on taxonomy term if you want it to individually specify the pages, you could specify that, I only wanted to show the inspiring one on this page and the test one on the test page but that doesn’t work if you’re going to scale to hundreds or a couple of hundred posts on a site especially if you want it all controlled on taxonomy term.

The other thing to keep in mind with mini-panels is it doesn’t have to just taxonomy term. It could be controlled on specific field on a content type and I’ll go ahead and show you that a little bit but for now we’re just going to check just the article and now we’re going to go ahead and go back one of our articles and we should be able to see both of them, and it is not showing up. Okay so I think the reason that it’s not showing up is that in order for the mini-panel to actually get that node context that we pass in, we have to be using panels and page manager.

So what we’re going to do is we’re going to go ahead and turn that on for this article, and to do that we go to Structure Pages and you’ll see there’s a node view by default but by default it is disabled so we’re going to enable it. And then we need to make sure that our article page is actually using a variant in here. So we’re going to go ahead and add a new variant and we’re going to go ahead and do this just for articles so it’s not going to change any other content type. So to do that we add a variant and select Selection Rules, we’re to look for node type, click Add and find the article here.

This means this variant will only show up for article content type and everything else so all the other content types will go back to their normal display. So we’re going to go ahead and hit Continue and we’ll go ahead and keep this as flexible for now just in case we wanted to change it and we’re going to leave everything else on the panel settings page at its default and this is going to get us to a layout designer. So here is where we want to come in and add all of our fields, so we’d want to add our body, we’ll just add that quickly and I’ll also add the tags field so we can see that. I’m just going to leave everything as default so we can see it working. I’m just going to show that for now.

There’s more we can add but really what you want to do is you wanted to use panels to design out that article page and the it’s going to allow us to show the mini-panel in the block because the context of this panels page, this page manager panels page is going to then be pass into that mini-panel So that’s the only way that the mini-panel can be aware of the actual node that we’re going to need and we need that because without having the node available you’re not going to specify specific fields or specific taxonomy terms to use to decide which one to display. So that is important, so we’re going to click Create Variant and I’ll click Update and Save, you can see we are saved now so I’m going to go ahead and go back to the homepage. You’ll notice that the article page is going to look different, it doesn’t have the image, it’s not designed out quite the same.

We could change that of course but you will notice we have this little block here, this mini-panel and it has both. Do you like inspirational posts and do you like posts with a test tag? So what we’re going to do now is dependent on which article we’re viewing. We only want to see one of these. So how do we do that? Well we go back into mini-panels, so go back to structure mini-panels and we’re going to edit our mini-panel here. We’re going to go into content and we have our two different pieces of content. If we click the little Gear Icon over here there’s a visibility rule. And so what these Visibility Rules are and these are very dynamic and very flexible on what you can do but you can control what shows up based on specific conditions.

So we’re going to add a new rule here and we’re going to look for node tags I believe, node article tags field. So we’re going to select that, click Next and this is for the first one so we’re going to select the tag that we’re going to show and keep in mind this doesn’t have to be taxonomy. This could be a field you added. Maybe you’ll only ever going to have three blocks or three pieces of custom content and you want to add a dropdown with the three fields and based on what you select you want to show the specific one, you can do that.

The Visibility Rules, as you can see there’s a bunch of options you can actually put in php code if you don’t want it to be specific to one of the node fields. You could use similar blocks, you could use URLs, only show it for specific user, those types of things. But for this we’re just using the tags field so this one is only going to show with the test tag, is selected. So we’re going to click Save, now if I did this right and if we come back, if I click on the first article that’s tagged with test, you can see do you like posts with the test tag, if I come back to the other one you’ll notice it says do you like inspirational posts. So as you can see this is really dynamic and flexible for how you want to build out your site to show different dynamic blocks based on the taxonomy terms of the posts itself.

So you can get really crazy with it and put all of different kinds of things in these blocks so you could put the blocks anywhere but it’s very contextual in a way. It only shows what you want based on what is actually in the content itself. So it’s pretty cool and you can do all kinds of cool things similar to what we did with the Code Karate site and if you do use this, let me know, I’d like to take a look and we can definitely share it out and show off all the cool stuff you can do with mini-panels.

So that’s it for this time, I think we went a little long but I think it’s pretty useful and something that a lot of people would be able to use on a lot of different Drupal websites. Make sure to check out codekarate.com, sign up for the newsletter if you haven’t already and we’ll see you next time. Goodbye.

Mar 02 2015
Mar 02

Commercial Progression was a proud sponsor of the 2015 DrupalCamp Michigan.  With over 100 in attendance, 11 formal presentations,  and 1 excellent after party... the survey results are in and the community agreed that this was the best DrupalCamp Michigan to date.  In addition to our general sponsorship, the Commercial Progresssion team represented well with 3 presentations covering all Drupal skill levels.  This year's media package also included a complete video capture of each session, which you can find on our youtube channel.

[embedded content]

Below you will find detailed information for each of the three Commercial Progression team presentations.  Dan Reinders lead the charge with his dynamic training style and in depth team workflow experience for Git and Features.  Not to be outdone, Hooked on Drupal's very own Brad Czerniak owned the classroom with "Variations on a Theme".  But perhaps the best was saved for last when the dynamic duo of Andy Blanchard and Chris Keller brought the house down with an inside look at their tools and custom workflows for modern web design.


Intro to Git and Features

By Dan Reinders
Level: Beginner

[embedded content]

Controlling your code is the foundation of a good development workflow.  Using Git and Features will allow you to wrangle Drupal and maintain (or regain) your sanity.

This session will be an introduction to git, including how to: use git, manage your code locally, migrate code to your server, and share code with your clients. We will also delve into using Features to allow Views, content types, Feeds, and other Drupal-y goodness to be exported to code and version controlled.


Variations on a Theme

By Brad Czerniak
Level: Advanced

[embedded content]

The benefits of a simply-coded, well-structured theme are obvious: maintainability, performance, self-esteem, and more. This session is an opinionated overview of theming best practices.

Templates and helper modules

Using blockify, field formatters, entity view modes, and other available tools allows your templates directory to be manageable and your template.php to focus on getting important things done.

Speaking of template.php, I'll demonstrate some reusable functions for adding utility classes that can come in handy in your stylesheets.


Whether you use a preprocessor or plain-old CSS, you can probably get away with fewer files and a smaller payload. I will spend a decent amount of time talking about why everything that everybody else does in their CSS is completely wrong, leaving you with a general idea of how to quikcly write CSS that accomplishes your business goals.

Resource payload

There are tons of ways to deliver fonts, images, icons, and other front-end bits to your pages. I'll explain the best way to do it in specific instances -- including a slick way to do social icons.


Tools for Modern Web Design

By Andy Blanchard and Chris Keller
Level: Intermediate

[embedded content]

As the sites we build get increasingly complicated simplifying or overlapping processes can be a great way to speed up delivery. In this talk, we'll share the techniques and tools we use at Commercial Progression to quickly produce high-quality design and frontend deliverables.


  • How wireframing can be a vacation from designing
  • Using wireframes to test the usability of your website
  • Why prototyping makes life easier and more complicated all at the same time
  • Explore front end development tools and their place in Drupal
    • CSS frameworks
    • CSS preprocessors
    • JS task runners

Complete DrupalCamp Michigan 2015 Presentation Archive

Join Michigan Drupal

Feb 19 2015
Feb 19

The Drupal 7 Interval Field module provides a simple way to create a duration or interval field on any Drupal 7 field-able entity. A common use for this might be on a content type that generally keeps track of dates. Sometimes it easier to summarize a group of dates to a user or visitor using an interval field rather than selecting multiple dates.

An interval field is useful for keeping track of data such as:

  • 5 hours
  • 33 seconds
  • 7 days
  • 3 months

Installing and configuring the module could not get any easier. To see it in action, simply install it like you would any other Drupal 7 module, and make sure to enable it on your module administration page. Now when you go to add a field to a content type, user, comment, or any other field-able entity, you will be able to create an Interval field.

When configuring the interval field, you can reduce the options presented to the user when an interval is created. For example, you can limit the options to only show the users "days" and "months" rather than allowing them to select from all of the interval options.

Really a simple module that can be useful. It really works best to provide a simplified way to store an interval, but also a user friendly way to present the data to a website visitor.

Hello everyone and welcome to another Daily Dose of Drupal. I am Shane Thomas, you can follow me on Twitter at smthomas3, also make sure to check codekarate.com, learn a little bit about our Drupal Commerce Course and our 5 Secrets EBook. We are on Episode Number 193 today and it’s going to be a short one and we’re going to be looking at the Interval Field Module. If you ever had a situation where you need to allow a field to show basically a duration, so two months, three days, four years, something like that on your Drupal site.

The Interval Field Module is just the solution for you. So it’s not something that you can use too often but there are a few situations where it can be helpful. So we’re going to go ahead and make sure we have it installed on our test site here. As you can see I have the 7.x-1.0 version installed. And so we’re just going to go to a content type. I have content type called Training. I’m just going to add a duration field to this. I’ll call it Duration and it’s actually going to be an Interval Field. So select Interval, as soon as you turn on the module you’ll have a new field type.

There’s only one widget so we’ll leave that at its default. So we click Save and now it allows you to set a few options here. So the first one is the allowed periods, so what you select here will be selectable by the user when they’re entering the value for this field. So let’s say we want minutes, hours and days. Let’s put months too, so there we go. We’ll leave out the other ones and we’ll set the default value to two hours and click Save. We’ll move this up there and now we’re going to go ahead and create a training content. We’ll create some training.

Alright so we’re going to go ahead and call this one Week Long Conference and let’s say it’s 4 days. You notice there’s only the four options that we selected here. I could add some text if I wanted to in the body and I’m just going to leave that. So you can see I now have a duration field that says 4 days. Pretty simple, this is something sometimes you can use in replacement of a date field or an addition to a date field. If you have something that spans a long duration sometimes it’s hard for people to understand how long that really is.

So a Duration Field or an Interval Field can help with that. Let’s go ahead and add another one here; let’s say we are scheduling a month long class so we want to say 1 month. Notice that it says one month here but when you save it, it notice that this is the singular so it’ll take the S of it. So if we click Save, you’ll notice it says 1 month and not 1 months. So it’s a super simple, module, there’s not much to it but it’s something that I think can be useful in specific situations where you want to really keep track of that interval versus just having a set of dates.

So go ahead and check it out, let us know what you think and if you have any other suggestions for our future videos in the Daily Dose of Drupal, make sure to head over to codekarate.com, click on Contact or send me a message on Twitter or something like that. Just get a hold of me. Until next time, see you later.

Feb 05 2015
Feb 05

In An Introduction to Git Part 4, you learned the basics of Git branches. You are now ready to push your Git repository to a Git hosting service such as Github or Bitbucket. After that, we will bring it all together and discuss possible ways to use Git in your next Drupal project.

Git is one of the secrets from my 5 secrets to becoming a Drupal 7 Ninja ebook, and much of the following posts are from this ebook. To learn more about Git and the other secrets, please consider purchasing the ebook or signing up for the 5 secrets email newsletter which will give you more information about the 5 secrets.

Pushing your Git Repository to Github or Bitbucket

In the next few sections we will look at both Github and Bitbucket and how to push your Git repository up to these Git hosting services. This section will only prove to be a really quick getting started. There is ample documentation on both of these services online if you choose to pursue using one or the other. First we will look at Github.

You will first need to create an account on github.com or bitbucket.com. Once you are logged into your account, you will want to set up your SSH keys. Your SSH Key is how Github or Bitbucket knows who you are. This way when you push up your changes, Github or Bitbucket will be able to determine if you have access to the Git repository you are trying to push or pull from. The first step is to make sure you have an SSH key setup on your local system. Since the setup varies depending on your operating system, you will want to search for something like “Generate SSH Key [operating-system]”. This should give you some results. If you are using a Linux based operating system or a Mac, you can probably just run the ssh-keygen command (however you should probably do a little research so you can understand the various options).

After you have an SSH key setup on your local system, you will have a .pub file available to you in your ~/.ssh/ directory (this might be slightly different on a Windows computer). Open up the .pub file (in my case it is id_rsa.pub) and copy the contents of the file.

In your Github or Bitbucket account, you will need to find the place in your account settings to manage your SSH Keys. You will need to add your SSH Key and probably give the key a title. You will then need to paste the contents from your .pub file into the Key section. You should now be hooked up to your Github or Bitbucket account allowing you to push and pull your Git repositories.

The next step is to create a new Git repository. When you create a new repository on Bitbucket or Github, you will be walked through the basic setup steps. You will then be given a few options and Git commands you can run. You should see some instructions showing how to push an existing repository from the command line.

Adding a Git remote

The first step to push up your existing Git repository is to add a new Git remote. You will then use this remote to push your Git repository to your Git hosting service.

Git Command What does it do? git remote add [remote-name] [remote-url] Adds a remote repository called [remote-name] located at [remote-url]. We can now push and pull from this repository (assuming we have permission). git push -u origin master Push our master Git branch to the remote called origin.

You should be able to copy and paste the git remote add command from Github or Bitbucket into your command line and run it. Then do the same with the git push -u origin master command. Your output should look something like this.

Git Add Remote

If you refresh the Github or Bitbucket page, you should now see your repository listed. You can now look through and begin using the online Git tools on your Git repository. Anytime you make a Git commit to your master branch you can simple run the git push origin master command to get the changes to be pushed up to Git hosting service. If someone else pushes changes to your Git repository and pushed it up, you can run a git pull origin master to pull in the changes to your local Git master branch.

You may have noticed that only the master branch is listed on Github or Bitbucket, you can push your other branches up as well. Simply run the git push origin [branch-name] command to push up a branch to your Github or Bitbucket repository or run git push origin --all to push up all your branches.

Using Git with Drupal

Now that you know the basics of Git, you are ready to apply this to your Drupal website. Go to your document root of your Drupal website and run the git init command.

Git Init Drupal

Drupal 7 comes with a .gitignore file for us to use. If you are using Git for a non Drupal project, you could create this with any text editor. The contents of the .gitignore file exclude the settings.php file, the Drupal files directory, and the Drupal private files directory. Here are the contents of the .gitignore file.

Drupal Git Ignore File

These patterns are set up to match files such as sites/default/settings.php as well as files such as sites/test.com/settings.php. This allows the Drupal multisite functionality to work correctly without allowing you to accidentally add in user generated files or a settings.php from one of your Drupal websites.

You are now ready to add all the files to your Git repository and make your first commit.

Git Add and Commit Drupal Repository

You are now able to use the Github, Bitbucket, or any other Git hosting service to push your repository up using the instructions above.

You may be thinking... "Is that it?" And the short answer is No, but it's a good start. There is not much difference using Git with Drupal or using Git on other types of files. The important thing is to remember that user generated files should not be added into the repository, and that you will most likely not want the settings.php file added into the repository (Note: some hosting services add in the settings.php file by loading in database credentials and other environment specific information from another file... but the important part is that your database credentials should not be in your repository).

Git summary: Where do you go from here?

Learning Git is intimidating. There are a lot of moving parts and a lot of things that can seem to go wrong. You will run into problems such as merge conflicts or trying to figure out how to undo commits, but these hurdles are worth the effort. Everyone makes mistakes, but what separates a Drupal developer from a Drupal Ninja, is the Drupal Ninja knows how to quickly and painlessly recover from those mistakes. You probably use some type of backup system for the hard drive of your computer. Git is like a supercharged collaborative backup and recovery system for your entire project.

If you liked learning about Git, make sure to check out the 5 Secrets to Becoming a Drupal 7 Ninja. It has some additional information on Git and other helpful secrets for building awesome Drupal websites. Also, grab a copy of the Code Karate Git Cheatsheet, to make remembering Git commands easy when you are just getting started.

Feb 04 2015
Feb 04

In the last section, An introduction to Git Part 3, you learned about adding and committing files to your Git repository. In this section, you will learn about Git branches and how using Git branches can help your Drupal development process. You will also learn a few different Git branch methodologies you can try out in your own Drupal projects.

Git is one of the secrets from my 5 secrets to becoming a Drupal 7 Ninja ebook, and much of the following posts are from this ebook. To learn more about Git and the other secrets, please consider purchasing the ebook or signing up for the 5 secrets email newsletter which will give you more information about the 5 secrets.

An Introduction to Git Branches

To me, Git branches are the most powerful feature Git has to offer. Initially they seem very complicated, but they are actually simple once you understand their uses and their benefits. One thing to keep in mind is that Git branches are incredibly flexible. Entire books and blogs have been written on how Git branches can be used in a specific way to build the ideal development process for various types of software. With that in mind, we will only be scratching the surface of
what Git branches offer.

Let’s start with a practical and possibly old fashioned example. Assume you are writing some type of paper. Assume you are using an old word processor that is not online, but is instead a program on your computer. You write the paper and decide that it needs a lot of work. Instead of editing the document directly, you make a copy and work on that document. This way if you really mess something up, you can just delete the copy and start over. When you are done with this copy and you like the changes, you may manually copy in the changes you like, or if you like all the changes, just get rid of your old version and use this new version as your paper.

This example is similar to how a Git branch works. You are essentially making a complete copy of your repository so you can work on new features, fix bugs, or keep different versions of your code. There are two common ways that I have used Git branches in the past.

Git Development Branch

The first and simplest way is to have a development and a master branch. All your new features are developed on the development branch, and when you have everything working and ready on the development branch, you merge the development branch into the master branch. This way you keep your master branch as the true “production level” code, while keeping a development branch to build new features and fix bugs on. This is a useful way to get started; however it starts to break down when you have a number of developers working on the same
branch at the same time.

In the diagram above, a copy of the master branch is made by creating a development branch. Development is then completed (each circle representing a Git commit). When the development is finished, the development branch is merged in with the master branch. In this model, the Development branch is always kept open.

Git Features Branch

The second way (and my preferred method) is to use Git branches to develop new features, or fix bugs. This is actually really simple if you take a second to think about it. Any change that you want going into the master branch (production/live code) must first originate as its own unique Git branch. If you need to fix a bug, you create a new branch to fix that bug, and when it’s ready, merge it into the master branch. If there is a new feature to be built, you create a new Git branch, develop the new feature, and when it’s ready merge it into the master branch. If you are working on just one thing at a time, this may seem like a little overkill. However, imagine you are working on two or three features at one time. Keeping separate Git branches for each feature means you can release one of the features without having to have all of the features completed.

In the diagram above, you can see that there are examples of both a Bug fix branch and a New Feature branch. Development is performed on each branch and as soon as the individual branch is ready, it is merged into the Master branch. The final circle in the Master branch contains both the Bug Fix and the New Feature. Using the Git feature branch process, the branch is closed after it has been merged in with the Master branch. It is important to keep in mind that in this
example you may have a good number of branches open at one time (depending on team size and what you are developing).

Ninja Lesson: If you use some type of project management or task management system (and you should), you can name your branches containing the id number of the task. For example if I have a task to add a newsletter signup form to a website with a task id of 123, I would create my branch and call it 123_newsletter_signup_form to make it easy to track down exactly what it is and why it was created.

There is a third and more complex way. If you are building more complex software with longer release cycles a method known as Gitflow (or various versions of it) can be used. The reason I don’t mention it in more detail is because it is slightly more complex and can lead to longer release cycles for your software. I enjoy having the ability for myself or the developers I work with to be able to make a change and have it released on the live website in the same day (sometimes in a matter of a few hours). This keeps the process lightweight and simple. In most
cases with websites you do not want long release cycles and instead want the process of getting something launched on the live site to be managed but not difficult.

Let’s look at the paper example again. You could email your paper to a friend for editing. Your friend would make some changes and suggestions and send it back to you. You would then decide which changes you want to keep and those that you are not going to use. In this example, think of your paper as the master Git branch. Your friend gets a copy (a new Git branch), makes some changes (some Git commits), and requests that the changes be merged in (a Git merge request). Now that you understand the basic concepts, we are ready to try out a few real examples.

Creating a Git Branch

The first step to learning how to actually implement Git branches is to create your first Git branch. In the following examples, we will go through the process of implementing a new branch to build a new feature. We will just use simple text files, but you should be able to easily see how it can be used with your code.

Git Command What does it do? git branch [branch_name] Create a new branch (copy of the code) to use to develop a new feature or fix a bug. git branch Lists all of the available branches

To create your first branch called my_new_feature, we just run the git branch my_new_feature command.

Git Create New Branch

In order to see all of the available Git branches in your repository, you can run the git branch command.

Git Branch Command

Notice in the example we have two branches, one called master and one called my_new_branch. The * character indicates the branch we currently have checked out. Any new commits we make will be on the currently checked out branch.

Checking out your Git Branch

Now that we have the branch created, we need to checkout the branch in order to start committing our code changes to it.

Git Command What does it do? git checkout [branch_name] Checks out an existing Git branch. This simply switches your code to a different Git branch. git checkout -b [branch_name] Creates a new Git branch and checks it out. This is a shortcut so you do not have to create the branch and check it out using two steps.

To checkout your my_new_feature branch, run the git checkout my_new_feature command. If you run the git branch command afterwards, you can see that you now have your new branch selected.

Git Checkout New Branch

There is also a shortcut command to create a branch and check it out at the same time. You can run the git checkout -b another_new_feature command to create a branch called another_new_feature and immediately check it out.

Git Create and Checkout Branch

Switching back to the my_new_feature branch is as simple as re-running the git checkout my_new_feature command.

Git Checkout Branch

Making changes on your new branch

Making changes on your new branch is exactly the same as before. Simply make the changes, add your changes to the staging area, and commit your changes to your Git branch. In this example we make a small change to a text file, add the change, and make the Git commit.

Git Committing a Branch

Merging a Git Branch

After you make your changes and you have those changes tested and ready to go, the time will come to merge in your changes from your feature branch into your master branch. Again, the master branch is typically the Git branch used for your production level code.

Git Command What does it do? git merge [branch_name] Merge [branch_name] into your currently checked out Git branch.

The first step is to checkout your master branch using git checkout master, after that you can merge in your my_new_feature branch into your master branch by running git merge my_new_feature.

Git Merging a Branch

Git Branches summary

You now know the basics of branches in Git. This is just the beginning, you will need to learn a lot more such as fixing conflicts and what to do with your Git branches when you are done with them. You will want to spend some time learning and experimenting with Git branches to find the workflow that works best for you. In An introduction to Git (part 5), we'll wrap it all up, learn about Git remotes, and learn how Drupal comes into the picture.

Feb 02 2015
Feb 02

Code Karate has recently posted numerous times on the importance of hosting and finding a reliable hosting service for your Drupal website. In this post I will introduce Site5 Hosting and demonstrate how it can be used to set up a Drupal website. If you are looking for a Drupal host, Site5 provides great service and support. If you are not sure yet, the instructions below are still useful for many hosting provides as it goes over the basics of CPanel (used by many shared hosting providers).

This is a sponsored post for Site5. Note that some of the links below are affiliate links and I will earn a commission if you purchase through those links. I have used all of the products listed below and recommend them because they are helpful and are from a company that I trust.

Site5 Drupal Hosting

  1. Video: Setting up a Site5 Account for Drupal Hosting
  2. Video: Installing Drupal 7 on Site5 Hosting
  3. Bonus Video: Setting up Drush on Shared Hosting

Creating a Site5 Shared Hosting Account

In this first video, we walk through how to set up a Site5 hosting account. If you are feeling adventurous and want to get started on your own. Go ahead and head over to the Site5 Drupal page and start the sign up process. Make sure to use the code CODEKARATE during checkout to get 3 free months of Site5 hosting!

Create a Site5 account (Affiliate Link)

Create a Site5 account (Non-Affiliate Link)

[embedded content]

Installing Drupal on a Site5 Shared Hosting Account

Now that your account is created you are ready to set up your Drupal website. This may vary depending on whether you are importing an existing Drupal website or creating a new Drupal website. In the example below, we will get a brand new Drupal website up and running.

[embedded content]

Installing Drush on Shared Hosting

BONUS: I have received many questions on how to set up Drush in a shared hosting environment. This is not always an easy task due to the limited resources that a shared hosting environment provides, but depending on the host, it can be configured to work. Watch the video below to learn how to set up Drush with a Site5 hosting account (Note: this will work with other CPanel based hosting providers).

[embedded content]

Drupal Shared Hosting with Site5 Summary

To sum it all up, Site5 is a great hosting provider for Drupal hosting. I personally don't have many sites hosted on the service yet, but going forward it will be my recommendation when someone asks me what shared hosting service to use to host a Drupal website. The Drupal install experience was faster than any other shared host I have used to date.

Host Drupal with Site5 (Affiliate Link)

Host Drupal with Site5 (Non-Affiliate Link)

Jan 29 2015
Jan 29

In An Introduction to Git Part 1, you learned what Git is and how to download it on your computer. In An Introduction to Git Part 2, you learned how to configure Git and create your first Git repository. In this section you will learn how to add and commit files to your new Git repository.

Git is one of the secrets from my 5 secrets to becoming a Drupal 7 Ninja ebook, and much of the following posts are from this ebook. To learn more about Git and the other secrets, please consider purchasing the ebook or signing up for the 5 secrets email newsletter which will give you more information about the 5 secrets.

Viewing Your Project Status

Git Command What does it do? git status View status information about your current Git repository.

The git status command is a command you will run early and often. It tells you the basics of what has changed with your Git repository. If you run the command now, you will see that there is nothing to commit yet. The command does tell you the branch that you are on (which we will cover later), as well as text telling you this is the “Initial commit”.

Git Status

Notice how the last line of the git status command tells you to create/copy files and use git add to track. Git is full of these helpful hints that tell you what you need to do. This can especially be helpful when you don’t know what to do or it has been awhile. I have spent way too much time searching the internet for answers, when the answer was often in the command output of the Git command I previously ran.

Ninja Lesson: Read the output of Git commands. It will save you time and headaches.

Open up a text or code editor and create a test file. Name your test file test.txt and keep the text really simple for now.

Example Text File

You will see what my current git_test directory looks like with the new test.txt file created.

Git Directory

Now re-run the git status command to see what has changed.

Git Status New File

Notice how the test.txt shows up under the “Untracked files” section. Also notice the line above the test.txt line that tells you how to add this file to include it in what will be committed.

You may have noticed the .git hidden folder inside the git_test folder. This hidden folder is created when we created the Git repository with the git init command. It is used to track everything about our Git repository. If you delete this folder, you are deleting your local Git repository.

Ninja Lesson: Do not delete the .git folder or you will delete your entire local Git repository.

Adding Files to your Git Repository

The next step in the process is to add the files to the Git staging area. The Git staging area is a middle ground between what has changed, and what has been committed to your Git repository. You can add files to this area and when you are ready, commit these files into one Git commit.

Git Command What does it do? git add [file] Add a specific file to the Git staging area of your repository. git add . Add all new/modified files inside the current directory to the staging area of your repository.

We are going to run the git add test.txt command to add the test.txt file to our Git staging area. We will then run the git status command to see that our file is now ready to be committed.

Git Add

If we had multiple files to commit, or we did not want to type in the file name, we can use the git add . command. The . (period) indicates to Git to add all new/modified files in the current directory or any subdirectories in the current directory (it does this recursively so even files in multiple levels of subdirectories would get added). We will use this command in future sections to provide a better idea of how it works.

Committing Your Changes to your Git Repository

A Git commit is a way to finalize and log the changes that we have added to our Git staging area. This essentially creates a new revision of your project at this particular point in time.

Git Command What does it do? git commit Commits all changes from the Git staging area, and launches a text editor to create a commit message. Save and close the text editor to complete the commit. git commit -m “My commit message goes here” Commits all changes from the Git staging area with the corresponding commit message.

You can use the git commit command to commit all of your staged changes. You will then need to fill out a commit message after the text editor is opened. After you save and close the file, the commit will be finalized.

You can also use the git commit -m command along with an inline commit message to simplify the process into one command. I prefer using this method as it is simpler than having to use a separate text editor tool. I also show the git status command after the commit which lets us know that we have nothing new to commit (our working directory is clean).

Git Commit

The commit message is much more important than it originally seems. The commit message provides a way for you to describe what has changed in the project. This makes it easy for you or others to quickly look at a history of commits to see how the project has changed over time.

Ninja Lesson: Commit early and commit often.

Viewing What Has Changed

Now that we have our first Git commit under our belt, we will make a few more changes. Let’s add an additional line to our test.txt file.

Example text file with new line

We will also create a new subfolder inside our git_test folder. Let’s call this directory test_folder.

Git test_folder

Inside this new test_folder directory, we will create a new file called test2.txt.

Second test file

We can now view the status of our git repository with the git status command.

Git Status

Notice the command output of the git status command lets us know that the test.txt file has been modified. It also lets us know about an untracked directory called test_folder.

Git Command What does it do? git commit Commits all changes from the Git staging area, and launches a text editor to create a commit message. Save and close the text editor to complete the commit. git diff Shows the changes between the last commit and the current working tree. This will only show changes in files that have been added to the repository.

Use the git diff command to see the specific changes of any files that have been modified.

Git Diff

Ninja Lesson: The git diff command only shows changes to files that are already being tracked by your Git repository.

We can use the previously mentioned git add test.txt command and a git add test_folder/test2.txt command to add the two files to the staging area, or we can use the git add . command to add both files for us automatically.

Git Add All

Ninja Lesson: The git add . command can be a real time saver, just be careful not to commit files you were not intending to commit.

You can now commit these changes. In this example, we will just use the git commit command without the -m to add the commit message.

Git Commit

Running this command will bring up a text editor to add a commit message. The text editor might vary depending on your system.

Git Commit editor

Now we simply add a commit message for this specific commit.

Git Commit Message in editor

We now save and close the text editor. This will complete the commit with your new commit message. This is just an alternative to adding the message directly within the commit command.

Git Commit Finished

Intro to Git Part 3 summary

You now know how to add and commit files to your Git repository. In An introduction to Git part 4 you will learn about Git branches and how they can be used within a Git repository. If you are looking for how this all relates to your Drupal projects, don't worry, we are getting there soon.

Jan 27 2015
Jan 27

In An introduction to Git Part 1, you learned a little about what Git and Version control is. You also installed Git on your computer. You are now ready to configure Git and set up your first Git repository. Whether you are using Git for the first time on a Drupal project, or for the 100th time, creating your Git repository always follows the same simple steps.

Git is one of the secrets from my 5 secrets to becoming a Drupal 7 Ninja ebook, and much of the following posts are from this ebook. To learn more about Git and the other secrets, please consider purchasing the ebook or signing up for the 5 secrets email newsletter which will give you more information about the 5 secrets.

Configuring Git from the command line

The first step is to open up your command line. You may want to create an empty test folder somewhere on your computer so you can test a few basic Git commands. I will start with a folder on my desktop called git_test. You will want to make sure you are inside that folder on your command line. If this is your first time using Git, you will likely need to configure your basic Git settings.

Git Command What does it do? git config --global user.name [name] Configure the username for Git to use for the current logged in user. git config --global user.email [email_address] Configure the user email address for Git to use for the current logged in user.

You will first want to configure your name.

Git Configuration: Username

Then you will want to configure your email address.

Git Configuration: Email

You should now have your basic Git configuration set up. You are now ready to create your first Git repository.

Creating Your First Git Repository

Git Command What does it do? git init Creates a Git repository in the current directory. git init [folder] Creates a new directory and Git repository.

Creating your first Git repository is incredibly simple. Just run the git init command on the command line from within your project folder.

Git Init

If you have not created the git_test folder yet, you can create the empty directory and the Git repository in one step.

Git Init Folder

Either of the above commands will create a new empty Git repository for you to start working with. It does not get much simpler than that. One simple command to Git you started.

Intro to Git Part 2 Summary

You now know how to configure Git from the command line and create your first Git repository. In part 3 of An introduction to Git, you will learn how to add files to your new Git repository.

Jan 20 2015
Jan 20

If you are not already using Git on your Drupal websites or projects, now is the time to learn. Over the next week or two, I will be going over a brief introduction to Git in 5 parts. In the following post, I will provide a quick overview of Git and Git hosting services. In subsequent parts, I will walk through examples of Git commands and what they do. In the 5th and final part I will bring it all together with examples of how Git is commonly used with Drupal.

Git is one of the secrets from my 5 secrets to becoming a Drupal 7 Ninja ebook, and much of the following posts are from this ebook. To learn more about Git and the other secrets, please consider purchasing the ebook or signing up for the 5 secrets email newsletter which will give you more information about the 5 secrets.


You have probably heard of Version Control or Git before. If you are not already using a Version Control system now is the time to start. According to the Git website:

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and

So what exactly is a Version Control System? To keep things simple, it is basically a way to track changes that you have made to files over a period of time. It gives you the ability to not only track those changes, but roll back to a previous point in time if something goes bad. A version control system also makes it much easier for multiple developers to work on a single project without stepping on each other’s toes.

Git is a Distributed Version Control System, which means that every developer working on a project has a full copy of the repository. A repository is just another name for how the project and its files are stored in the version control system. Generally when working with Git you will have some type of server that you push your changes too. Often this will be a third party service like GitHub, Bitbucket, or one of the many other alternatives.

Choosing the Right Service to Host Your Git Repository

There are a lot of options to consider when choosing where (and if) you want to use a third party service to host the Git repository for your project. These services provide a lot of useful tools that make working with your Git repository easier. Some standard tools to keep an eye out for include:

  • Ability to view the code of your Git repository
  • Issue or Bug tracking
  • Create and manage Git branches of code
  • Built in Code Review Tools
  • Collaboration tools to make building a software project with a team easier

There are typically many more features, but that is a basic list that almost all Git hosting services offer. It is best to do your own research here as opinions tend to vary on which is the best. The most popular one is probably Github. It provides a great interface and great collaboration tools. Github is especially popular in the open source software market. Github is free to use as long as you make your Git repository public. Github charges for you to have a private repository. Github bases its fees on the number of private repositories you require.

Bitbucket is another popular choice. Bitbucket has free Git project hosting for teams of 5 or less. Bitbucket allow for an unlimited number of public or private Git repositories. All of the fees for Bitbucket are based on the number of people on the team (not the number of repositories). This distinct difference between Bitbucket and Github often helps you decide based on the type of project you are building and the team size (assuming you are basing your decision only on price). There are many other options out there, but these are the most widely used that I am aware of.

So which Git project hosting service do I use? Well... both actually. I prefer using Github for any type of open source project. Github’s interface and collaboration tools are slightly better than Bitbucket’s in my opinion. I do however use Bitbucket much more than I use Github. Because I often tend to work on projects in small teams, and I need private repositories for much of my work, Bitbucket is the logical choice. I also don’t want to discount the tools in Bitbucket as they too are really good (Github is just slightly more user friendly).

Ninja Lesson: All Git Hosting services will follow the same constructs. Learn Git and you can easily adapt to the hosting service of your choosing.

Getting Started with Git

So how do you go about getting start with Git if you have never worked with a Version Control System before? The first steps are to start by downloading Git for your operating system. Once you have Git downloaded and installed, you may be tempted to download a Git GUI client. You can browse for one of your choosing and try one out (I have used GitEye with some success in the past as it provides a Linux version). I won’t be covering Git GUI clients because frankly I don’t like using them and I think they shroud what is actually happening (sometimes making it seem more confusing than it has to be). Even if you do want to use a Git GUI client, I highly suggest learning the basics from the command line first. This will give you a much deeper understanding of what various commands are doing and how the entire Git process works.

Intro to Git Part 1 Summary

In the subsequent 4 parts, you will be able to follow along to create your first Git repository, learn the basics of Git commands, create a larger Git repository for your Drupal website, and learn how to pull down external Git repositories (like those on Github or Bitbucket).

So start out by following the instructions for your Operating system and getting Git installed. In the introduction to Git part 2, we will get started with some basic Git commands and configuration.

Jan 15 2015
Jan 15

The Drupal 7 Auto Assign Role module allows you a lot of flexibility in deciding what roles users receive on your Drupal 7 website. If you have ever needed to allow a user to select their own role, or if you have ever needed to automatically assign a role to every user on your Drupal site. This is the module for you.

There are three options for configuring the auto assign role module. One is to always automatically assign a specific role to every user that signs up for your site. The second option is to allow a user to select one or more roles on the user registration page when they are signing up for their user account. The last option is to have separate registration pages for each role. This one allows you to really design the user registration process to a specific workflow.

This module can be very useful on social networking sites, forum or discussion board sites, some types of ecommerce sites (where you might want to allow users to sign up as sellers), and much more. This module is useful anytime you want a user to be able to categorize themselves into a specific role, and you want those roles to have different permissions across your site.

Jan 15 2015
Jan 15

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 190 and we’re going to be covering the Auto Assign Role Module. But before we get started I am Shane Thomas, make sure to follow me on Twitter at smthomas3. Also make sure to head on over to codekarate.com, check out the EBook and all the other useful Drupal information.

So let’s go ahead and get started; The Auto Assign Role Module, it’s a really simple module but it does some pretty powerful things. It allows you to really control how users get roles on your Drupal site. So there are options to allow you to Auto Assign a role anytime a user assigns up for your site but you can also set it so the user can select their own role. And this is very powerful if you’re building out a site where…depending on what kind of user you want to have or what type of users you have coming to your site.

You may want to give them different permissions for…and since if you’re building an education site, you might want a teacher and a student role and the user would select that one they sign up. In this case we’ll go through one example with a reviewer or a manager role just as simple example since I already have those roles on this test site.

So make sure to go over to your test site and turn on the Auto Assign Role Module. Once that is installed we are going to go ahead and go to the configuration page and there are three options here and we’ll go through each of these. The first one is automatic.

So if we click on that you can see we can enable automatic role assignment which essentially means if any user creates a new account on your site they will be automatically whatever roles you check down here. Otherwise you can also turn on Automatic Role Assignment for Admin created accounts and this means any role that you would create as an admin would get or any user would get the role that you select down here. So if you want to make sure that either all admin accounts are all user created accounts end up getting a specific role, this module can be used to do that.

I’m not going to go through a demo on that because it’s pretty straight forward. The per role pages, we’ll go through that one last and we’ll start or we’ll go second with the User Choice. This one is pretty cool because you can actually allow the user to select their role on the user registration form. So the first thing we have to do is enable it. So we change this to Enabled and then we select the roles that they should be able to select from.

We don’t want to allow them to become an administrator of course but we will allow them to select either a manager or a reviewer role and this will just show any roles that you have on your site. So if you need to change your roles you can always go to people permissions and then roles. You can select if they should be able to select one or more than one role when signing up.

We’ll just keep it with one and then if you want radio buttons or select box, if you want it to be required I’ll go ahead and say yes, how do you want to sort it, what kind of description and what title do you want to show up. Let’s go ahead and hit Save and I will open up a new window here and we will go to the site and click on the Create New Account button. You’ll now see there’s a role selection here where I can select either Manager or Reviewer. You can see the description shows up there, the field set title and the actual field title.

I’ll go ahead and sign up for one here and I will select to be a manager and click Create New Account. Now I don’t have the ability for users to be able to create and sign into their own accounts. It’s still set up to require admin approval but this works regardless of how you have that set up on your Drupal site. So if I come back here and go to the people page you’ll see there’s a test role user I just created. It is blocked because I have to manually approve them but it does have the role of manager.

So that’s an easy way to allow on your user registration form a user to just select the role they want. The other option is to configure per role pages and this basically means you can create different paths or different sign-up forms and depending on the sign-up form that they go to is the roles or the role that they will receive.

So we’re going to create one for the manager role and we give it a title. We give it a path so we’re going to give it manager-signup. You can add it to a menu if you want if you want to actually to display in a menu item and you can select the display type. If you select standard it will show the normal user registration, user login, requesting your password, Drupal tabs, if you show it individually it will not show those tabs. I’ll leave this one at standard and I’ll change the other one to individual so we can see what the difference is there. So here’s the manager signup, so let’s also add a Reviewer signup page, so we give it a title and a path, we’re going to select individual this time and go ahead and click Add.

Now if we come back to the site you’ll notice we still have these options so we could turn that off if we wanted to but if I go to manager-signup you can see it’s the manager signup title which means if I sign up for this form I’m going to become a manager and receive the manager role. And also notice how the tabs are showing up here.

If I go to reviewer-signup there are no tabs. There we go, so I just created a quick reviewer account on that reviewer signup page so we can ensure that I would get the reviewer role. So if we come back to the people page and refresh you’ll notice here’s my username, here’s the role I would have receive and there we go. That’s the Auto Assign Role Module. So as you can see it allows a lot of flexibility with controlling how roles are assigned throughout your Drupal site.

So this is incredibly useful if you’re building out as I mentioned before, some kind of social network site or education site where there are different roles and different permissions that need to be applied to those different users. So go ahead and give that one a try, make sure to check out codekarate.com and let us know if you want anything that we don’t already have up there and we’ll see you next time. Thanks for watching.

Jan 09 2015
Jan 09
[embedded content]

After creating hundreds of Drupal videos and blog posts on various topics, and after receiving many comments and email's, we started to realize a few trends over time. One of the things we received a lot of questions and interest in, was creating ecommerce sites in Drupal.

In Drupal 7, we think the best way to create an ecommerce website is to use Drupal Commerce. We have created some videos in the past that covers some of the basic concepts of Drupal Commerce, but in order to really get through those videos, you have to know quite a bit about Drupal.

We decided that we needed to build a more complete series to really teach how to get a Drupal Commerce site set up from beginning to end, from setting up the Drupal site to the official launch. We wanted a course that was aimed at beginners and would work for those with some basic knowledge of Drupal, or possibly no knowledge at all.

So we are now announcing the official release of our Drupal Commerce course. This course is a 4.5+ hour course with 60 videos. The course walks through setting up a Commerce Kickstart website where you learn to manage products, inventory, orders, payments, shipping, taxes, and much more. You also learn some ways to change the design of the store without any coding.

Our goal is not only to help those already in the Drupal world learn how to sell products online, we also want to help those that are not using Drupal yet. So if you are interested in learning how to sell products online, using Drupal and Drupal Commerce, take a look at our course over at Udemy:

Code Karate's Drupal Commerce Course

The Price is currently set at $249. This includes the 4.5 hour course and 60 videos. This also includes our support in helping you along the way of building and launching your Drupal Commerce site.

This is a great course if you:

  • Want to build an ecommerce website of your own to sell your products
  • Want to learn how to build ecommerce websites so you can build them for other people/companies

So go ahead and check out the course over on Udemy.com. We are really happy with how it turned out and think you will be too. Let us know what you think!

Since we are just launching this course, we are providing a big incentive for those who want to be the pioneers and take the course in the first week after it's launch. Simply use the coupon CKPIONEER and you will get $100 off. This offer is good until January 16th, 2015 so go sign up for the course today!


About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web