1

In the process of developing a distribution, I'm stuck with the task to customize the install.php page. Can't find a way to change the tpl/layout of the installation process or which preprocess function to use.

I'd like to do the same as Commerce Kickstart did, in a certain way.

Any ideas how?

2 Answers 2

3

Here's the trick that Kickstart uses (from commerce_kickstart.install). The actual styling is in the Shiny admin theme.

/**
 * Implements hook_install_tasks_alter().
 */
function commerce_kickstart_install_tasks_alter(&$tasks, $install_state) {
  _commerce_kickstart_set_theme('shiny');
}

/**
 * Force-set a theme at any point during the execution of the request.
 *
 * Drupal doesn't give us the option to set the theme during the installation
 * process and forces enable the maintenance theme too early in the request
 * for us to modify it in a clean way.
 */
function _commerce_kickstart_set_theme($target_theme) {
  if ($GLOBALS['theme'] != $target_theme) {
    unset($GLOBALS['theme']);

    drupal_static_reset();
    $GLOBALS['conf']['maintenance_theme'] = $target_theme;
    _drupal_maintenance_theme();
  }
}
1

Have you reviewed the code used in the Commerce Kickstart distribution? They don't really change the "layout". What they did was they modified the glbal variable in kickstart that stores the theme used:

if ($GLOBALS['theme'] != $target_theme) {
    unset($GLOBALS['theme']);

    drupal_static_reset();
    $GLOBALS['conf']['maintenance_theme'] = $target_theme;
    _drupal_maintenance_theme();
  }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.