php - 创建 Moodle 2 主题

标签 php themes moodle

我创建了一个新的 Moodle 主题,正如 Moodle 文档所建议的那样。

在 config.php 文件中,我定义了如下布局:

$THEME->layouts = array(
    // Most pages - if we encounter an unknown or a missing page type, this one is used.
    'base' => array(
        'theme' => 'nop',
        'file' => 'general.php',
        'regions' => array('side-pre', 'side-post'),
        'defaultregion' => 'side-post'
    ),
    'standard' => array(
        'theme' => 'nop',
        'file' => 'general.php',
        'regions' => array('side-pre', 'side-post'),
        'defaultregion' => 'side-post'
    )
);

创建后,我在 Moodle 的管理区域中选择了它,并清理了缓存。在管理主题选择页面中,我可以看到该主题的颜色、样式和新界面,但是,在 Moodle 的其他区域(每隔一个页面)我看不到它。

有人知道为什么会发生这种奇怪的事情吗?

谢谢

最佳答案

我可以通过在 config.php 文件中添加此代码来解决这个问题。

$THEME->layouts = array(    // Most pages - if we encounter an unknown or a missing page type, this one is used.
    'base' => array(
        'theme' => 'nop',
        'file' => 'general.php',
        'regions' => array('side-pre', 'side-post'),
        'defaultregion' => 'side-post'
    ),
    'standard' => array(
        'theme' => 'nop',
        'file' => 'general.php',
        'regions' => array('side-pre', 'side-post'),
        'defaultregion' => 'side-post'
    ),
    'frontpage' => array(
        'theme' => 'nop',
        'file' => 'general.php',
        'regions' => array('side-pre', 'side-post'),
        'defaultregion' => 'side-post'
    ) );

关于php - 创建 Moodle 2 主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10719794/

相关文章:

mysql - 更改 MySQL innodb_file_format 和 large_prefix 是否会对其他网站造成任何问题?

moodle - 从moodle获取用户信息

javascript - 如果 1 个值大于另一个值,则按钮提交时发出通知

javascript - PHP 检查变量是否已设置

php - 搭建MySQL数据库,避免多表访问

jquery - 如何从主题滚轮站点在 jquery mobile 中添加自定义主题?

适用于 Java 的 Eclipse IDE - 全深色主题

php - CSS 背景不显示

templates - Tumblr 使用什么模板语言?

ftp - 通过 FTP 将类(class)上传到 Moodle