Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #21602 > unrolled thread

Jinja2 + jQuery tabs widget

Started byJoeM <josephmeiring@gmail.com>
First post2012-03-14 07:16 -0700
Last post2012-03-14 07:50 -0700
Articles 3 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  Jinja2 + jQuery tabs widget JoeM <josephmeiring@gmail.com> - 2012-03-14 07:16 -0700
    Re: Jinja2 + jQuery tabs widget Jon Clements <joncle@googlemail.com> - 2012-03-14 07:39 -0700
    Re: Jinja2 + jQuery tabs widget JoeM <josephmeiring@gmail.com> - 2012-03-14 07:50 -0700

#21602 — Jinja2 + jQuery tabs widget

FromJoeM <josephmeiring@gmail.com>
Date2012-03-14 07:16 -0700
SubjectJinja2 + jQuery tabs widget
Message-ID<1715f106-4e6f-45db-b224-fb9f219c2027@x17g2000yqj.googlegroups.com>
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>


[toc] | [next] | [standalone]


#21605

FromJon Clements <joncle@googlemail.com>
Date2012-03-14 07:39 -0700
Message-ID<1279295.3910.1331735941023.JavaMail.geo-discussion-forums@vbue17>
In reply to#21602
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.

[toc] | [prev] | [next] | [standalone]


#21607

FromJoeM <josephmeiring@gmail.com>
Date2012-03-14 07:50 -0700
Message-ID<32873446.2390.1331736610160.JavaMail.geo-discussion-forums@vbfl9>
In reply to#21602
Disregard, apparently you can't include a {block} more than once in a Jinja2 template, which was causing the error. 

Cheers, 
Joed

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web