By justin | Tue, 04/21/2015 - 21:10
Drupal 7 is by far my favorite CMS to date and Zurb Foundation is currently my go to theme. Although, I wouldn't really call Foundation a theme, but more of a responsive front-end framework that you can use to build your themes from.
Here is how to setup a fresh copy of Drupal 7 and configure a Foundation sub-theme quickly to get your project up and running:
Install Drupal Using Drush
Although you can do this all the old fashion way, I prefer to use drush for this. Here are the drush commands to make this all happen:
drush dl drupal --drupal-project-rename=drupalsitename
This command will download the latest version of drupal and rename the directory to “drupalsitename”. Rename “drupalsitename” to whatever you want to call your new drupal project.
This command is straightforward - it puts you inside the drupal root directory, which is where you need to be for the next few commands.
drush site-install standard --account-name=username --account-pass=password --db-url=mysql://username:password@localhost/drupalsitedb
This command will configure drupal and create a new database. Replace the account username and password accordingly to what you want your drupal root user to be. Replace the mysql username and password with your proper mysql credentials and rename “drupalsitedb” to whatever you want to call your new database.
Foundation Sub-theme Using Drush
Now that drupal 7 has been installed, we need to download the latest Zurb Foundation theme. To do this, run the following command:
drush dl zurb_foundation
This will download the latest stable release of Zurb Foundation into the sites/all/themes directory.
At the time of writing this post, the latest release is 7.x-4.1 and uses Foundation 4. This will work just fine, however, I prefer to use Foundation 5, so you may want to download the latest version that runs on Foundation 5 (7.x-5.0-rc6).
To do this, you need to specify the version number when you download the theme like so:
drush dl zurb_foundation-7.x-5.0-rc6
Next, we need to create a foundation sub-theme. This is what we will use to build our new theme from. Run the following command:
drush fst drupalthemename
This will create a proper Foundation sub-theme and place it in the sites/default/themes directory. Replace “drupalthemename” with the name of your theme.
Finally, navigate to /admin/appearance and make sure your new theme is enabled and set to default. You can also do this in drush using the following command:
drush vset theme_default drupalthemename
At this point drupal is now setup and configured with your new custom Foundation sub-theme. It’s now time to roll up those sleeves and start coding!
If you or your team needs some help with Drupal Development, let us know! We do a lot of backend work for agencies that need more hands-on-deck to finish big projects. Give us a call!