yogthos/Selmer

Parameters in include

Open

#90 aperta il 27 lug 2015

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)Clojure (86 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (670 star)
Metriche merge PR
 (Merge medio 39m) (4 PR mergiate in 30 g)

Descrizione

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.

Guida contributor