Jinja2 + jQuery tabs widget

Discussion in 'Python' started by JoeM, Mar 14, 2012.

  1. JoeM

    JoeM Guest

    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>
    JoeM, Mar 14, 2012
    #1
    1. Advertising

  2. JoeM

    Jon Clements Guest

    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.
    Jon Clements, Mar 14, 2012
    #2
    1. Advertising

  3. JoeM

    JoeM Guest

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

    Cheers,
    Joed
    JoeM, Mar 14, 2012
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. qwweeeit
    Replies:
    2
    Views:
    635
    qwweeeit
    Dec 14, 2005
  2. Aaron Gray
    Replies:
    20
    Views:
    379
    Lasse Reichstein Nielsen
    Jul 27, 2008
  3. lorlarz
    Replies:
    6
    Views:
    207
    David Mark
    Mar 25, 2010
  4. Robert Iulian

    Jinja2 installation help

    Robert Iulian, Feb 8, 2013, in forum: Python
    Replies:
    6
    Views:
    178
    Robert Iulian
    Feb 9, 2013
  5. Satabdi Mukherjee
    Replies:
    3
    Views:
    123
    Cousin Stanley
    Apr 7, 2013
Loading...

Share This Page