Django-cms - CMS javascript 未包含在前端

发布于 2024-12-08 09:47:58 字数 394 浏览 4 评论 0原文

我正在按照官方 介绍性教程,我在前端的编辑模式方面遇到了一些问题。首先,顶部横幅未显示,占位符上的编辑菜单全部损坏。 我做的第一件事是检查 Javascript 错误,很快我发现 CMS 脚本没有被包含和初始化。没有为 {% render_block "js" %} 标记生成任何内容。

我在网上搜索了官方文档和用户列表,但没有发现任何有关此问题的信息。

编辑: Sekizai 工作正常,问题似乎出在 django-cms 上。

I'm creating a website with Django-Cms following the offcial Introductory Tutorial and I'm having some issues with the edit-mode on the frontend. First of all, the top banner is not showing and the edit menus on the placeholders are all broken.
The first thing I did was to check for Javascript errors and quickly I found that the CMS scripts are not being included and initialized. Nothing is being generated for the {% render_block "js" %} tag.

I have searched the official documentation and user-lists on the web and I have found nothing about this issue.

EDIT:
Sekizai is working correctly, the problem seems to be with django-cms.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

半窗疏影 2024-12-15 09:47:58

我花了一些时间才发现这一点,并且文档没有在任何地方提到它,但从版本 2.2 开始,必须在编辑模式中添加 cms_toolbar django 标签才能正常工作。

It took me some time to discover this and the documentation didn't mention it anywhere but from version 2.2 onwards a cms_toolbar django tag must be added within the for the edit mode to work correctly.

梦与时光遇 2024-12-15 09:47:58

请注意,教程需要以下#*< /em> 标记的代码行,使编辑菜单出现在您在教程中制作的第一页上。我已将此情况通知开发商。

更新:我正在阅读旧版本的教程。 这里是最新版本。

{% load cms_tags sekizai_tags %}
<html>
  <head>
      {% cms_toolbar %} #***
      {% render_block "css" %}
  </head>
  <body>

      {% placeholder base_content %}
      {% block base_content%}{% endblock %}
      {% render_block "js" %}
  </body>
</html>

Note that the tutorial needs the following #* tagged line of code for the edit menu to appear on the first page you make in the tutorial. I've informed the developers of this.

update: I was reading an old version of the tutorial. Here is the latest version.

{% load cms_tags sekizai_tags %}
<html>
  <head>
      {% cms_toolbar %} #***
      {% render_block "css" %}
  </head>
  <body>

      {% placeholder base_content %}
      {% block base_content%}{% endblock %}
      {% render_block "js" %}
  </body>
</html>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文