Tuesday, October 1, 2013

Using Drush to deploy themes and modules to multi-sites on CentOS

Previously I discussed setting up multi-site on CentOS, now, using Drush, we can also download, enable, and set themes and modules for individual sites.  The default Drupal7 site gets all the glory of files downloaded to it, but the individual sites should be the ones showing the updates.

Steps to use Drush:

1) cd /var/www/vhosts/drupal7/sites/your.alternative.site
get into the correct folder that you want to have the theme enabled
2) drush dl theme
This is the last part of a url available from drupal, i.e. drupal.org/project/omega would use omega

3) drush en theme
This enables the them for all sites. From what I understand, the files themselves get downloaded to the main drupal7/sites/all/themes/ directory. Somehow Drupal knows to find the themes for each individual site, which in the next step we set as the default. Setting it this way makes it available to all sites to enable themselves, but not as a default for all sites. If you'd like it to be exclusive just for your one site, and not maintained for the rest of them, you might have to just move it around or not use drush for that...not sure? ask on the forums.

4) drush vset theme_default theme
This sets the default theme for the site that you're in. This is awesome because it does it only for the specified site. Even if I set the Drupal7 default site default theme, it would have no impact on the other sites because they all get their own choices.

5) drush pm-list --type=theme
this last one is pretty neat because drush has some pretty cool project management tools. this one just lists out all of the themes available for your main installation, including the package it comes with, the name, status, and version.


No comments:

Post a Comment