首页 > 解决方案 > 使用所见即所得编辑器的默认布局损坏,“无法加载 Jquery”错误

问题描述

问题发生在我将十月 CMS 配置为从设置中使用所见即所得编辑器时。

默认布局工作正常。但是,当我打开默认布局文件时,所见即所得编辑器(我认为)更改了一些代码,现在我的 CMS 无法加载任何样式。我试图重新创建默认布局文件。但是控制台抛出错误

*framework.js:9 Uncaught Error: The jQuery library is not loaded. 
The OctoberCMS framework cannot be initialized.
at framework.js:9*

这意味着 10 月现在无法加载 Jquery。在我自己编辑之后,我的默认布局看起来像这样。

<html>
<head>
<title>{{ this.page.title }}</title>
{% styles %}
{% framework extras %} {% scripts %}
</head>
<body>
{% partial "site/header" %}
{% page %}
{% partial "site/footer" %}
</body>
</html>

我试图将脚本标签移到底部,但没有帮助。默认布局应该能够加载所需的文件。

编辑:

好的,我能够以艰难的方式解决这个问题(重新安装)。实际的布局文件如下所示:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>October CMS - {{ this.page.title }}</title>
<meta name="description" content="{{ this.page.meta_description }}">
<meta name="title" content="{{ this.page.meta_title }}">
<meta name="author" content="OctoberCMS">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="OctoberCMS">
<link rel="icon" type="image/png" href="{{ 'assets/images/october.png'|theme }}">
 <link href="{{ 'assets/css/vendor.css'|theme }}" rel="stylesheet">
 <link href="{{ 'assets/css/theme.css'|theme }}" rel="stylesheet">
{% styles %}
</head>
<body>

<!-- Header -->
<header id="layout-header">
{% partial 'site/header' %}
</header>

<!-- Content -->
<section id="layout-content">
{% page %}
</section>

<!-- Footer -->
<footer id="layout-footer">
{% partial 'site/footer' %}
</footer>

<!-- Scripts -->
<script src="{{ 'assets/vendor/jquery.js'|theme }}"></script>
<script src="{{ 'assets/vendor/bootstrap.js'|theme }}"></script>
<script src="{{ 'assets/javascript/app.js'|theme }}"></script>
{% framework extras %}
{% scripts %}

</body>
</html>

标签: octobercms

解决方案


推荐阅读