首页 > 解决方案 > 为什么“无”出现在 Django cms 的导航栏和正文之间

问题描述

我在导航栏和正文之间没有任何东西,但是这个 None 出现了,我无法理解为什么。我正在共享我的主页模板出现的位置。检查导航栏和占位符滑块之间的代码。

{% load cms_tags menu_tags sekizai_tags static %}  <!--load template libraries of Sekizai and CMS tag -->
{% load thumbnail %}
<!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>

<!-- slider -->
{% block base_content %}
  {% placeholder Slider %}
{% endblock %}
  <!-- Page Content -->

问题是这个

标签: htmldjangowebdjango-templatesdjango-cms

解决方案


推荐阅读