mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-19 16:54:25 +00:00
The `custom field long choice` aim to provide a way to deal with choices with a big possibilities. The `custom field long choice` allow : - to persist different options in the database ; - each option has a key, a text (translatable string), and eventually a parent, and an internal_key - every key can be activate or not. If the parent is inactivated, all childs are inactivated - the internal key have two purposes : - link to an external csv file, with their own key ; - add a special class to results, to allow custom layout. Currently, the field exists, but some elements are missing : - a script for CSV import - possibility to select multiple items - edition of options - handle of option without parents - tests are missing
11 lines
583 B
Twig
11 lines
583 B
Twig
{% if values|length > 0 %}
|
|
<ul class="custom_fields long_choice {% if values|length == 1 %}unique{% endif %}">
|
|
{%- for value in values -%}
|
|
<li class="long_choice_item long_choice-key-{{ value.key }} long_choice-ikey-{{ value.internalKey }} long_choice-parent-ikey-{{ value.parent.internalKey }}">
|
|
<i class="fa fa-check-square-o"></i> {{ value.text|localize_translatable_string }}
|
|
</li>
|
|
{%- endfor -%}
|
|
</ul>
|
|
{% else %}
|
|
<div class="custom_fields_choice long_choice empty">{{ 'None'|trans }}</div>
|
|
{% endif %} |