Skip to content

Commit

Permalink
Data template fixes (getgrav#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoHood authored Feb 11, 2021
1 parent a0500ed commit 817d553
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion templates/forms/default/data.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@
{% set use_keys = field.use is defined and field.use == 'keys' %}
{% for key,value in form.value(scope ~ field.name) %}
{% set index = (use_keys ? key : value) %}
<li>{{ field.options[index]|e }}</li>
<li>{{ field.options[index]|t|e }}</li>
{% endfor %}
</ul>
{% elseif field.type == 'radio' %}
{% set value = form.value(scope ~ field.name) %}
{{ field.options[value]|t|e }}
{% elseif field.type == 'checkbox' %}
{{ (form.value(scope ~ field.name) == 1) ? "GRAV.YES"|t|e : "GRAV.NO"|t|e }}
{% elseif field.type == 'select' %}
Expand Down

0 comments on commit 817d553

Please sign in to comment.