yogthos/Selmer

Parameters in include

Open

#90 geöffnet am 27. Juli 2015

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Clojure (86 Forks)batch import
enhancementhelp wanted

Repository-Metriken

Stars
 (670 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 39m) (4 gemergte PRs in 30 T)

Beschreibung

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.

Contributor Guide