Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django引导传送带_Django_Twitter Bootstrap_Django Templates_Bootstrap Carousel - Fatal编程技术网

Django引导传送带

Django引导传送带,django,twitter-bootstrap,django-templates,bootstrap-carousel,Django,Twitter Bootstrap,Django Templates,Bootstrap Carousel,我试图在django模板中使用Twitter3引导转盘。第一个“项”显示得很好,但其他项都不显示-这些“控件”什么都不显示。为什么其他旋转木马项目都不显示 <div class="container-fluid recent"> <h2>Recently Published Datasets</h2> <div id="recent-carousel" class="carousel slide" data-ride="carousel">

我试图在django模板中使用Twitter3引导转盘。第一个“项”显示得很好,但其他项都不显示-这些“控件”什么都不显示。为什么其他旋转木马项目都不显示

<div class="container-fluid recent">
  <h2>Recently Published Datasets</h2>

  <div id="recent-carousel" class="carousel slide" data-ride="carousel">

    <!-- Wrapper for slides -->
    {% for registration in recent_registrations %} 
    <div class="carousel-inner" role="listbox">
      {% if forloop.first %}
      <div class="active item">
      {% else %}
      <div class="item">
      {% endif %}
        <div class="col-md-6 col-md-offset-3">
          {% include 'databank/includes/dataset_item.html' with registration=registration %}
        </div>
      </div>
    </div>
    {% endfor %}

    <!-- Controls -->
    <a class="left carousel-control" href="#recent-carousel" role="button" data-slide="prev">
      <span class="glyphicon glyphicon-chevron-left"></span>
    </a>
    <a class="right carousel-control" href="#recent-carousel" role="button" data-slide="next">
      <span class="glyphicon glyphicon-chevron-right"></span>
    </a>

  </div> <!-- Carousel -->

</div>

最近公布的数据集
{在最近的注册中的注册百分比%}
{%if-forloop.first%}
{%else%}
{%endif%}
{%include'databank/includes/dataset_item.html',registration=registration%}
{%endfor%}
进口:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link href="{{STATIC_URL}}css/bootstrap_css/bootstrap.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="{{STATIC_URL}}js/bootstrap_js/bootstrap.min.js"></script>
<link href="{{STATIC_URL}}css/bootstrap_css/bootstrap.css" rel="stylesheet">

包含的模板:

{% load databank_filters %}

<a class="pull-left" href="{% url 'databank:dataset' registration.dataset.dataset_id %}">
  {% if registration.dataset.dataset_image %}
  <img class="media-object img-thumbnail" src="{{ registration.dataset.dataset_image.url }}" onerror="if (this.src != '{{ MEDIA_URL }}/thumbnails/default/sbgrid_logo_circle.png') this.src = '{{ MEDIA_URL }}/thumbnails/default/sbgrid_logo_circle.png';" style="height: 130px; width: 130px">
  {% else %}
  <img class="media-object img-thumbnail" src="{{ MEDIA_URL }}/thumbnails/default/sbgrid_logo_circle.png" alt="Data Image Here" style="height: 130px; width: 130px">
  {% endif %}
</a>


<div class="media-body no-top-margin">
  <a href="{% url 'databank:dataset' registration.dataset.dataset_id %}" role="link"><h3 class="media-heading">{{ registration.dataset.dataset_name }}</h3></a>
  <p>{{ registration.dataset.dataset_description }}</p>

</div>
{%load databank_filters%}
{{registration.dataset.dataset_description}


Imports在@zarch中添加了一个“常规”旋转木马,但效果很好。只有在我尝试将Django数据放入其中后,它才停止工作…现在将代码粘贴到{%include'databank/includes/dataset_item.html'中,注册=registration%}xdclude已粘贴。@steph如果您查看控制台,单击按钮时会出现什么错误?你有错误吗?你的模板看起来不错。。。此外,您还将导入jQuery两次—您应该删除其中一个。最后-你能确认其他项目出现在HTML中吗?