【问题标题】:Drupal 7 Maintenance Mode Custom Page Not workingDrupal 7维护模式自定义页面不起作用
【发布时间】:2014-09-01 15:10:38
【问题描述】:

前奏

  • Drupal 7
  • 引导业务(活动主题)
  • 开启维护模式

我已经执行的操作

  1. modules/system/maintenance-page.tpl.php复制maintenance-page.tpl.php
  2. 根据您的需要进行编辑
  3. 粘贴到主题的根目录 --> /public_html/sites/all/themes/bootstrap-business
  4. /public_html/sites/default/settings.php 中设置$conf 变量:$conf['maintenance_theme'] = 'bootstrap_business';`

尽管如此,该网站仍继续显示 modules/system/maintenance-page.tpl.php 。我不知道为什么它不起作用。我也试过:

  • 添加maintenance-page--offline.page.tpl.php
  • 设置主题名称为bootstrap-business

以上都不起作用。我认为在如此简单的任务上花费 45 分钟是不够的。我知道我可以编辑 modules/system/maintenance-page.tpl.php,但我不认为这是正确的方法。

有什么建议吗?

【问题讨论】:

    标签: drupal-7 maintenance-mode


    【解决方案1】:

    清除/刷新缓存(主题注册表缓存),然后重试。如果您已经这样做并且没有工作,请为您的默认主题添加页面预处理功能template.php

    bootstrap_business_preprocess_maintenance_page(&$variables) {
      if (isset($variables['db_is_active']) && !$variables['db_is_active']) {
    // Template suggestion for offline site
        $variables['theme_hook_suggestion'] = 'maintenance_page__offline';
      }
    else {
    // Template suggestion for live site (in maintenance mode)
        $variables['theme_hook_suggestion'] = 'maintenance_page';
     }
    }
    

    相关问题:https://drupal.stackexchange.com/q/76946/12163

    【讨论】:

    • 没什么,这太不可思议了。
    猜你喜欢
    • 1970-01-01
    • 2011-02-02
    • 1970-01-01
    • 2014-02-23
    • 1970-01-01
    • 2013-06-07
    • 1970-01-01
    • 2015-12-06
    • 1970-01-01
    相关资源
    最近更新 更多