Developing Distributions with Panopoly

Panopoly is designed to be used as a "base distribution" for other distributions to leverage to quickly build awesome Drupal distributions full of all the magic Panopoly has to offer! In order to take advantage of Panopoly as a base distribution, you need to do the following things:

Include Panopoly's Modules & Libraries In Your Distribution

Panopoly requires several contributed modules and external libraries to function correctly, often with specific patches necessary to make everything work together magically. These modules and libraries must be installed as part of your distribution in order to use the power of Panopoly. In order to do this, add the following lines to your profile's make file:

NOTE: This is a sample code, which can be outdated easily. You can look for the latest code used in Panopoly's make file.

Another good place to look for how this is being used is in Open Atrium's make file, which should normally be up to date to the latest stable panopoly release.


; The Panopoly Foundation

projects[panopoly_core][version] = 1.15
projects[panopoly_core][subdir] = panopoly

projects[panopoly_images][version] = 1.15
projects[panopoly_images][subdir] = panopoly

projects[panopoly_theme][version] = 1.15
projects[panopoly_theme][subdir] = panopoly

projects[panopoly_magic][version] = 1.15
projects[panopoly_magic][subdir] = panopoly

projects[panopoly_widgets][version] = 1.15
projects[panopoly_widgets][subdir] = panopoly

projects[panopoly_admin][version] = 1.15
projects[panopoly_admin][subdir] = panopoly

projects[panopoly_users][version] = 1.15
projects[panopoly_users][subdir] = panopoly

; The Panopoly Toolset

projects[panopoly_pages][version] = 1.15
projects[panopoly_pages][subdir] = panopoly

projects[panopoly_wysiwyg][version] = 1.15
projects[panopoly_wysiwyg][subdir] = panopoly

projects[panopoly_search][version] = 1.15
projects[panopoly_search][subdir] = panopoly

; For running the automated tests.

projects[panopoly_test][version] = 1.15
projects[panopoly_test][subdir] = panopoly

This will automatically package all of the Panopoly specific modules and dependent modules and libraries through some drush make magic. You will also need to enable them as part of your installation profile which can be done by making sure the following lines are in your profile's info file:

NOTE: This is a sample code, which can be outdated easily. You can look for the latest code used in Panopoly's info file.

; Drupal Core
dependencies[] = block
dependencies[] = menu
dependencies[] = image
dependencies[] = list
dependencies[] = number
dependencies[] = options
dependencies[] = path
dependencies[] = taxonomy
dependencies[] = search
dependencies[] = shortcut
dependencies[] = field
dependencies[] = field_ui
dependencies[] = file
dependencies[] = dblog
dependencies[] = update

; Panopoly Foundation
dependencies[] = panopoly_core
dependencies[] = panopoly_images
dependencies[] = panopoly_theme
dependencies[] = panopoly_magic
dependencies[] = panopoly_widgets
dependencies[] = panopoly_admin
dependencies[] = panopoly_users

; Panopoly Toolset
dependencies[] = panopoly_pages
dependencies[] = panopoly_search
dependencies[] = panopoly_wysiwyg

; Panopoly Recommended - Admin & UI
dependencies[] = navbar
dependencies[] = breakpoints
dependencies[] = backports
dependencies[] = simplified_menu_admin
dependencies[] = save_draft
dependencies[] = module_filter
dependencies[] = date_popup_authored
dependencies[] = views_ui

; Panopoly Recommended - Other
dependencies[] = devel
dependencies[] = distro_update
dependencies[] = uuid
dependencies[] = apps

Set your distro as the default option on install

Panopoly sets its install profile as the default option when installing by simply adding exclusive = 1 in the profile's info file. You can do the same for your distribution.

Enable Support for Panopoly's Special Install Task

Panopoly improves the dependency checking of the core installer which helps simplify sub-profiles. In order to get both of these working in your install profile, you need to include the following code to your profile's hook_install_tasks_alter().

NOTE: This is a sample code, which can be outdated easily. You can look for the latest code used in Panopoly's profile file.

/**
 * Implements hook_install_tasks_alter()
 */
function MYDISTRIBUTION_install_tasks_alter(&$tasks, $install_state) {
 // Magically go one level deeper in solving years of dependency problems
  require_once(drupal_get_path('module', 'panopoly_core') . '/panopoly_core.profile.inc');
  $tasks['install_load_profile']['function'] = 'panopoly_core_install_load_profile';

  // If we only offer one language, define a callback to set this
  require_once(drupal_get_path('module', 'panopoly_core') . '/panopoly_core.profile.inc');
  if (!(count(install_find_locales($install_state['parameters']['profile'])) > 1)) {
    $tasks['install_select_locale']['function'] = 'panopoly_core_install_locale_selection';
  }
}

Enable Support for Panopoly's Apps and theme selection (Optional)

Panopoly leverages the Apps module to enable the many apps that create magic with Panopoly. It also adds a theme selection step with the new bartik responsive theme as default. In order to get this working in your install profile, you need to include the following code to your profile's hook_install_tasks().

NOTE: This is a sample code, which can be outdated easily. You can look for the latest code used in Panopoly's profile file.

/**
 * Implements hook_install_tasks().
 */
function MYDISTRIBUTION_install_tasks($install_state) {
  $tasks = array();

  // Add our custom CSS file for the installation process
  drupal_add_css(drupal_get_path('profile', 'panopoly') . '/panopoly.css');

  // Add the Panopoly app selection to the installation process
  $panopoly_server = array(
    'machine name' => 'panopoly',
    'default apps' => array('panopoly_demo'),
    'default content callback' => 'panopoly_default_content',
  );
  require_once(drupal_get_path('module', 'apps') . '/apps.profile.inc');
  $tasks = $tasks + apps_profile_install_tasks($install_state, $panopoly_server);

  // Add the Panopoly theme selection to the installation process
  require_once(drupal_get_path('module', 'panopoly_theme') . '/panopoly_theme.profile.inc');
  $tasks = $tasks + panopoly_theme_profile_theme_selection_install_task($install_state);

  return $tasks;
}

Enhance Distribution Functionality with Panopoly Development Patterns

Once you have the required Panopoly apps installing and your distribution based on Panopoly, it is important to enhance your existing distribution to take advantage of Panopoly development patterns (i.e. switch to using Panopoly's responsive layouts, convert blocks to panel panes) which are outlined in the documentation on developing sites with Panopoly.

Panopoly Base Distribution Starter Kit

This is a starter kit for using Panopoly as a base distribution. Just follow the instructions to make a base distribution here (http:/

Guide maintainers

populist's picture