On 2/23/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote:
>
> On 2/22/06, Ivan Fedorov <[EMAIL PROTECTED]> wrote:
> > What is Jinja?
> >
> > Jinja is a text-based template language similar to cheetah and Smarty.
> > The syntax and parts of the code where taken from the django template.
> >
> > http://wsgiarea.pocoo.org/jinja/
>
> Hey Ivan,
>
> What are the differences between Jinja and Django's template system?
> At a glance, I see little things such as different available default
> template filters and the fact that you have to use stuff like
> FileSystemLoader()?
>
> Rather than creating a separate project, why not just integrate your
> changes into Django templates proper? We're going to make them
> downloadable as a standalone package for Django's next version.
>
> Adrian
>
I saw there is :

Capture Output

Captures output and stores it in a variable:

{% capture as loopdata %}
    {% for item in navigation %}
        <li><a href="{{ item.href }}">{{ item.caption|escapexml }}</a></li>
    {% endfor %}
{% endcapture %}

The output of the for loop is now stored in the variable loopdata.

This allows the double usage of block tags:

{% capture as title %}{% marker "title" %}{% endcapture %}
<html>
    <head>
        <title>{{ title|escapexml }} | My Webpage</title>
    </head>
    <body>
        <h1>{{ title }}</h1>
        {% marker "body" %}
    </body>
</html>

Modify / Set Variables

{% define %} allows you to set a variable.

Usage:

{% define my_variable "Some Value" %}

You can also apply filters:

{% define escaped content | escapexml %}


These things are very interesting, maybe we could also implement them in Django.


--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to