【问题标题】:Toggle Structure in Django-cms toolbar is DisabledDjango-cms 工具栏中的切换结构已禁用
【发布时间】:2021-06-23 08:05:19
【问题描述】:

问题:CMS 工具栏隐藏了导航栏菜单,现在已禁用(未向上移动)。 Django 版本 = 3.0.8 Django cms = 3.8.0 我有基本模板和主页模板。这里我分享基本模板代码。我应该添加什么来解决问题?

<!-- this is base template -->
{% load static %}
{% load cms_tags menu_tags sekizai_tags static %}  <!--load template libraries of Sekizai and CMS tag -->
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}"> <!-- in case you want other languages -->
<head>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content=""> {% page_attribute "meta_description" %} <!--should have description of pages-->
  <meta name="author" content="">

  <title>Smart Learn - {% page_attribute "page_title" %} </title> <!--In title page name should come first then website title -->

  {% render_block "css" %} <!-- loading css here render_block comes with sekizai lib to allow templates to included-->
  <!-- Bootstrap core CSS -->
  {% addtoblock "css" %} <!--for sekizai tags -->
  <link href="{% static "vendor/bootstrap/css/bootstrap.min.css"  %}" rel="stylesheet">
  {% endaddtoblock %}
  <!-- Custom styles for this template -->
  {% addtoblock "css" %}
  <link href="{% static "css/smart-learn.css" %}" rel="stylesheet">
  {% endaddtoblock %}

</head>
{% cms_toolbar %}<!--  from cms toobar -->
<body>

  <!-- Navigation -->
  <nav class="navbar fixed-top navbar-expand-lg navbar-dark bg-dark fixed-top">
    <div class="container">
      <a class="navbar-brand" href="/">Smart Learn</a>
      <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarResponsive">
        <ul class="navbar-nav ml-auto">
         {% show_menu 0 100 100 100 %} <!-- for cms menu -->
         <li class="nav-item">
            <a class="#" href="about.html">About</a>
          </li>
          <li class="nav-item">
            <a class="#" href="services.html">Services</a>
          </li>
        </ul>
      </div>
    </div>
  </nav>
  {% block content %}{% endblock %}
  <!-- Footer -->
  <footer class="py-5 bg-dark">
    {% static_placeholder "Footer" %}
  </footer>
  <!-- Bootstrap core JavaScript -->
  {% addtoblock "js" %}
  <script src= "{% static "vendor/jquery/jquery.min.js" %}"></script>
  {% endaddtoblock %}
  {% addtoblock "js" %}
  <script src= "{% static "vendor/bootstrap/js/bootstrap.bundle.min.js"  %}"></script>
  {% endaddtoblock %}
{% render_block "js" %} <!--to put all js template designs on home -->
</body>
</html>

如何将该图标转换为可以轻松上下移动的箭头? This is what I have This is what I need

【问题讨论】:

    标签: html django bootstrap-4 django-cms djangocms-text-ckeditor


    【解决方案1】:

    模板中有占位符标签吗?

    {% block base_content %}
      {% placeholder some_content %}
    
    {% endblock %}
    

    如果没有,导航栏将被禁用。

    【讨论】:

    • 我有基本模板和主模板。我不知道我应该把上面的代码块放在哪里
    • 好的,你能拍张首页模板的照片或者检查里面的内容标签你有没有占位符?如果不是像我描述的那样添加任何东西,它就会起作用。
    • 我的主页模板有您发送的代码,这就是为什么现在启用切换结构但我想要的是能够看到隐藏在此栏下的菜单的箭头。
    猜你喜欢
    • 2020-08-17
    • 2015-09-17
    • 2011-06-05
    • 1970-01-01
    • 1970-01-01
    • 2016-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多