开发者

How do I use JQuery UI tabs with Django (or other tab-solution)?

I would like to use the JQuery UI tabs in my Django app but how should I d开发者_StackOverflow中文版o that? I cannot figure it out with Django's template system.

Or, is it another smoother way to get tabs in a Django app?

Thanks /Tobbe


Tobbe,

This is how I'm doing it, may not be ideal, but it works:

Create a base.html file with all the common html elements you need. Then have blocks that define different parts of the file. For instance:

<HTML>
<HEAD><TITLE>My Page</TITLE></HEAD>
<BODY>
{% block tabs %}
Put your tab code here. The content is actually in the tab block that is why the endblock for the tabs block is after the content block.
{% block content %}Default content{% endblock content %}
{% endblock tabs %}
</BODY>
</HTML>


What does JqueryUI has to do with django templates? Those things are orthogonal - just use it the same way you would use them in html file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜