Jinja2 + jQuery tabs widget

J

JoeM

Hi All,

I'm having issues including a {block} of content from Jinja2
template into a jQueryUI tab. Does anyone know if such a thing is
possible? An example is below, which gives me a 500 error when loading
the page.

Thanks,
Joe



<script>
$(function() {
$( "#tabs" ).tabs();
});
</script>

<div id="tabs">
<ul>
<li><a href="#tabs-Sum">Summary</a></li>
<li><a href="#tabs-Maps">Maps</a></li>
<li><a href="#tabs-Tables">Tables</a></li>
<li><a href="#tabs-Ani">Animations</a></li>
<li><a href="#tabs-Def">Definitions</a></li>
</ul>
<div id="tabs-Maps">
{% block map_content %} {% endblock %}
</div>
</div>
 
J

Jon Clements

Hi All,

I'm having issues including a {block} of content from Jinja2
template into a jQueryUI tab. Does anyone know if such a thing is
possible? An example is below, which gives me a 500 error when loading
the page.

Thanks,
Joe



<script>
$(function() {
$( "#tabs" ).tabs();
});
</script>



<ul>
<li><a href="#tabs-Sum">Summary</a></li>
<li><a href="#tabs-Maps">Maps</a></li>
<li><a href="#tabs-Tables">Tables</a></li>
<li><a href="#tabs-Ani">Animations</a></li>
<li><a href="#tabs-Def">Definitions</a></li>
</ul>


{% block map_content %} {% endblock %}
</div>
</div>

Firstly, this isn't really a Python language question - although jinja2 is a commonly used module for web frameworks.

Secondly, the code looks fine, except we don't know what's in the map_content block.

Thirdly, 500 is an internal server error - so it's possible it's nothing to do with any of this anyway -- could you provide a more comprehensive error message?

Jon.
 
J

JoeM

Disregard, apparently you can't include a {block} more than once in a Jinja2 template, which was causing the error.

Cheers,
Joed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top