在moodle登录页面中更改Title标签的顺序

时间:2017-11-21 22:45:43

标签: moodle

目前Moodle添加了Content-Type元标记

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
标题标签后

<title>Mount Orange School: Log in to the site</title>
头标记内的

<head>
    <title>Mount Orange School: Log in to the site</title>
    <link rel="shortcut icon" href="https://school.demo.moodle.net/theme/image.php/boost/theme/1511289361/favicon" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
...
...
</head>

我们如何在moodle3.1核心(https://github.com/moodle/moodle/blob/MOODLE_31_STABLE/login/index.php#L374)中以最小的变化更改此顺序。将内容类型元标记放在Head标记的顶部。像这样的东西。

 <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Mount Orange School: Log in to the site</title>
        <link rel="shortcut icon" href="https://school.demo.moodle.net/theme/image.php/boost/theme/1511289361/favicon" />
    ...
    ...
    </head>

我们正在使用http://nutch.apache.org/,如果内容类型Meta未被定义为Head中的第一个标记,则它不会读取标题。

enter image description here

参考1:view-source:https://school.demo.moodle.net/login/index.php

参考2:https://school.demo.moodle.net/login/index.php

参考3:https://github.com/moodle/moodle/blob/MOODLE_31_STABLE/login/index.php#L374

1 个答案:

答案 0 :(得分:0)

有两种方法可以做到这一点。

  1. 在此处更改核心代码https://github.com/moodle/moodle/blob/MOODLE_31_STABLE/theme/bootstrapbase/layout/columns1.php#L30

  2. 创建自定义主题并导入基本主题并在其中进行更改。

  3. https://edwiser.org/blog/create-child-theme-moodle/

    https://docs.moodle.org/dev/Themes

    更改哪个需要

    <head>
        <title><?php echo $OUTPUT->page_title(); ?></title>
        <link rel="shortcut icon" href="<?php echo $OUTPUT->favicon(); ?>" />
        <?php echo $OUTPUT->standard_head_html() ?>
    .....
    

    <head>
        <?php echo $OUTPUT->standard_head_html() ?>
        <title><?php echo $OUTPUT->page_title(); ?></title>
        <link rel="shortcut icon" href="<?php echo $OUTPUT->favicon(); ?>" />
    
    ....
    
相关问题