How to read outside of {% %} using nunjucks parser for creating an extension

188 views Asked by At

I am trying to create an extension for data binding. But due to unavailability of the parse documentation, I am stuck.

For the below syntax, how do I check/read the "type", i.e. how do i read something outside of {% %}.

<input type="text" id="categoryName" {% data-bind "category.name" %}  />
<input type="checkbox" id="categoryIsTop" {% data-bind "category.isTopLevel" %}  />

The below syntaxes work fine and will use it only if the above is not possible.

{% input "id=categoryName, value=category.name, type=text" %}
{% input "id=categoryIsTop, value=category.isTopLevel, type=checkbox %}


<input id="categoryName" {% data-bind "text category.name" %}  />
<input id="categoryIsTop" {% data-bind "checkbox category.isTopLevel" %}  />
0

There are 0 answers