-
-
Notifications
You must be signed in to change notification settings - Fork 169
/
Copy path_taxonomies.html.twig
62 lines (53 loc) · 2.68 KB
/
_taxonomies.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{% import '_macro/_macro.html.twig' as macro %}
{% for taxonomy in record.definition.taxonomy %}
{% set definition = config.get('taxonomies/' ~ taxonomy) %}
{% if definition %}
{% set options = taxonomy_options(definition) %}
{% set value = taxonomy_values(record.taxonomies, definition) %}
<div class="mb-4">
{# Print prefix #}
{% if definition['prefix']|default() is not empty %}
{{ macro.generatePrefix(definition['prefix'], taxonomy) }}
{% endif %}
{% if definition.has_sortorder %}<div class="row"><div class="col-9">{% endif %}
{% include '@bolt/_partials/fields/_label.html.twig' with {
'id': 'taxonomy-' ~ definition.slug,
'label': definition.name,
'required': definition.required
} %}
{% if definition.has_sortorder %}
</div><div class="col-3">
{% include '@bolt/_partials/fields/_label.html.twig' with {
'id': 'taxonomy-' ~ definition.slug ~ '-sortorder',
'label': 'Order'|trans,
'required': false
} %}
</div>
</div>
{% endif %}
{% if definition.has_sortorder %}<div class="row"><div class="col-9 AAA">{% else %}<div>{% endif %}
<editor-select
:value="{{ value.0 }}"
:name="'taxonomy[{{ definition.slug }}]'"
:id="'taxonomy-{{ definition.slug }}'"
:options="{{ options }}"
:multiple="{{ definition.multiple ? 'true' : 'false' }}"
:taggable="{{ (definition.behaves_like == 'tags') ? 'true' : 'false' }}"
></editor-select>
{% if definition.has_sortorder %}
</div><div class="col-3 BBB">
<editor-number
:id="'taxonomy-{{ definition.slug }}-sortorder'"
:name="'taxonomy[{{ definition.slug }}-sortorder]'"
value="{{ value.1.first() }}"
:step="1"
></editor-number>
{% endif %}
</div>
{# Print postfix #}
{% if definition['postfix']|default() is not empty %}
{{ macro.generatePostfix(definition['postfix'], taxonomy) }}
{% endif %}
</div>
{% endif %}
{% endfor %}