Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameters in include #90

Open
ivajloip opened this issue Jul 27, 2015 · 1 comment
Open

Parameters in include #90

ivajloip opened this issue Jul 27, 2015 · 1 comment

Comments

@ivajloip
Copy link

Hello,
I am trying to use an include tag when passing parameters as follows

{% include "views/pagination.html" with controller="users" %}

While getting the value of the parameter controller works with {{}} syntax, it does not seem to be in the context-map and thus is not usable in custom tags in the partial ("views/pagination.html" in my case).

My current solution is rather ugly

{% with controller=controller|default:"users" %}
  {% include "views/pagination.html" %}
{% endwith %}

so I would like to know if there is a better way to do something like that or will it be very difficult for me to implement it?

Note: This might be related to #78.

@yogthos
Copy link
Owner

yogthos commented Jul 27, 2015

Currently, the with option in the include tag only handles static content. This is handled by the split-include-tag. It should be possible to extend that to allow dynamic content if you're up for taking a look at that.

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

No branches or pull requests

2 participants