Why is jinja not passing content into bootstrap tabs beyond initial active tab?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Why is jinja not passing content into bootstrap tabs beyond initial active tab?



Content within first active tab renders perfectly. However, subsequent tabs fail to display jinja generated content in their panes. These panes display HTML, and will display content explicitly provided via Flask, but they are not generating content between jinja {% for x in xs %} blocks. Here is my code... What have I overlooked?




<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />

<title>r.io</title>



<!-- Bootstrap core CSS -->
<link href="{{ url_for('static', filename='css/bootstrap.css') }}" rel="stylesheet">
<script src="{{ url_for('static', filename='js/jquery-3.3.1.min.js') }}"></script>

</head>
{% block body %}
<header>
<nav class="navbar navbar-expand navbar-dark flex-column flex-md-row bd-navbar">
<div class="container">
<a class="navbar-brand" href="{{url_for('cs.index')}}">
<img src="{{ url_for('static', filename = 'images/Logo_Header.png') }}" class="d-inline-block align-top" alt="r.io"> r.io
</a>
<ul class="navbar-nav flex-row ml-md-auto d-none d-md-flex">
<li class="nav-item dropdown">
<a class="nav-item nav-link dropdown-toggle mr-md-2" href="{{ url_for('cs.index') }}" data-toggle="dropdown" aria-expanded="false">
<img src="{{ url_for('static', filename = 'images/active.png') }}" alt="D">
</a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="{{ url_for('cs.C', r_id=r_id) }}">
<img src="{{ url_for('static', filename = 'images/inactive.png') }}" class="d-inline-block align-top" alt="C"> C
</a>
</div>
</li>
</ul>
</div>
</nav>

</header>

<body>
<div class="container">
<br>
<div class="row">
<div class="col-md-4">
<table>
<tr>
<td><img src="{{ url_for('static', filename=logo)}}" alt="BTC" height="35px" width="35px"> &nbsp;</td>
<td>
<h1>Bn</h1>
</td>
</tr>
</table>
</div>
<div class="col-md-8">
<nav>
<div class="nav nav-tabs justify-content-end" id="nav-tab" role="tablist">
<a class="nav-item nav-link active" id="nav-home-tab" data-toggle="tab" href="#nav-home" role="tab" aria-controls="nav-home" aria-selected="true">Tech</a>
<a class="nav-item nav-link" id="nav-profile-tab" data-toggle="tab" href="#nav-profile" role="tab" aria-controls="nav-profile" aria-selected="false">Fun</a>

</div>
</nav>
</div>
</div>
<div class="row">
<div class="col-md-3">

SOME STATIC TABLE CONTENT HERE

</div>
<div class="col-9">
**THIS FIRST TAB WORKS GREAT
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="nav-home" role="tab" aria-labelledby="nav-home-tab">
<span>CHART GOES HERE</span>
<table>
<tr>
{% for date in dates %}
<td style="width: 120px; font-size: small; text-align: center;">{{ date }}</td>
{% endfor %}
</tr>
</table>
</div>**

*########## THIS TAB DOES NOT RENDER Jinja Content. WHY? ################
<div class="tab-pane fade" id="nav-profile" role="tab" aria-labelledby="nav-profile-tab">
<div class="active" style="margin-left: 20px"><br>
<h4>A Headline</h4>
<table>
{% for doc in docs %}
<tr>
<td><img src="{{ url_for('static', filename=icon) }}"></td>
<td><a href="{{ doc.link }}">{{ doc.title }}</a></td>
</tr>
{% endfor %}
</table>*
</div>
</div>
</div>
</div>
</div>
</div>
<script src="{{ url_for('static', filename='js/dataTables.bootstrap4.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/popper-1.14.3.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
{% endblock %}
</body>





What are you passing to the template in the way of docs? How are you passing it to the template? Is there a chance that list may be empty?
– trevdev
23 hours ago







Hi @trevdev so the problem was actually in a typo someplace within my database models. I thought I had thoroughly debugged, but rebuilding the data models solved the issue. I should delete this question, but I appreciate your inquery and response. Thank you.
– Josh Delacroix Valentine
6 hours ago









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Keycloak server returning user_not_found error when user is already imported with LDAP

PHP parse/syntax errors; and how to solve them?

How to scale/resize CVPixelBufferRef in objective C, iOS