Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Jinja2 + jQuery tabs widget

Reply
Thread Tools

Jinja2 + jQuery tabs widget

 
 
JoeM
Guest
Posts: n/a
 
      03-14-2012
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>



 
Reply With Quote
 
 
 
 
Jon Clements
Guest
Posts: n/a
 
      03-14-2012
On Wednesday, 14 March 2012 14:16:35 UTC, JoeM wrote:
> 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.
 
Reply With Quote
 
 
 
 
JoeM
Guest
Posts: n/a
 
      03-14-2012
Disregard, apparently you can't include a {block} more than once in a Jinja2 template, which was causing the error.

Cheers,
Joed
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jinja2 installation help Robert Iulian Python 6 02-09-2013 01:15 PM
Tkinter.event.widget: handler gets name instead of widget. Frederic Rentsch Python 0 07-08-2012 09:19 PM
Microsoft expanding it use of jQuery & involvement with jQuery lorlarz Javascript 6 03-25-2010 10:14 PM
jQuery Query about comparing jQuery references Aaron Gray Javascript 20 07-27-2008 01:53 PM
user interface widget: ordered selection list: do any UI library has this widget? zhangweiwu@realss.com Javascript 0 10-10-2006 01:02 AM



Advertisments