Skip to content

Allow passing arguments inside other tags such as include #325

Description

@IArnaut2

I am switching to Jinja2 because Django Templates does not allow passing arguments to methods.

Regular Jinja2 does not allow passing arguments within include in a single line.

{% include "../partials/pagination.html" with listings=page_obj %}

That code won't work and it throws this error: ("expected token 'end of statement block', got 'with'",).

You have to split the line into multiple, which makes it uglier and it sucks.

{% with listings=page_obj %}
    {% include "../partials/pagination.html" %}
{% endwith %}

And doing this with many tags is redundant.

Can you make Django-Jinja allow with inside other tags like Django Template?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions