added field_weight to assisted research terms for sorting

This commit is contained in:
Bachir Soussi Chiadmi 2021-05-20 19:45:21 +02:00
parent 29a77178d5
commit 90883384f4
7 changed files with 263 additions and 28 deletions

View File

@ -4,6 +4,7 @@ status: true
dependencies: dependencies:
config: config:
- field.field.taxonomy_term.assisted_research.field_terms - field.field.taxonomy_term.assisted_research.field_terms
- field.field.taxonomy_term.assisted_research.field_weight
- taxonomy.vocabulary.assisted_research - taxonomy.vocabulary.assisted_research
module: module:
- field_group - field_group
@ -14,6 +15,7 @@ third_party_settings:
children: children:
- group_list - group_list
- group_admin - group_admin
- group_sidebar
parent_name: '' parent_name: ''
weight: 1 weight: 1
format_type: tabs format_type: tabs
@ -54,6 +56,21 @@ third_party_settings:
formatter: closed formatter: closed
required_fields: true required_fields: true
label: admin label: admin
group_sidebar:
children:
- field_weight
parent_name: group_tabs
weight: 20
format_type: tab
region: content
format_settings:
description: ''
open: '1'
required_fields: true
id: ''
classes: ''
formatter: closed
label: weight
id: taxonomy_term.assisted_research.default id: taxonomy_term.assisted_research.default
targetEntityType: taxonomy_term targetEntityType: taxonomy_term
bundle: assisted_research bundle: assisted_research
@ -69,6 +86,13 @@ content:
third_party_settings: { } third_party_settings: { }
type: entity_reference_autocomplete type: entity_reference_autocomplete
region: content region: content
field_weight:
weight: 10
settings:
placeholder: ''
third_party_settings: { }
type: number
region: content
langcode: langcode:
type: language_select type: language_select
weight: 3 weight: 3

View File

@ -4,6 +4,7 @@ status: true
dependencies: dependencies:
config: config:
- field.field.taxonomy_term.assisted_research.field_terms - field.field.taxonomy_term.assisted_research.field_terms
- field.field.taxonomy_term.assisted_research.field_weight
- taxonomy.vocabulary.assisted_research - taxonomy.vocabulary.assisted_research
module: module:
- text - text
@ -27,6 +28,15 @@ content:
third_party_settings: { } third_party_settings: { }
type: entity_reference_label type: entity_reference_label
region: content region: content
field_weight:
weight: 2
label: above
settings:
thousand_separator: ''
prefix_suffix: true
third_party_settings: { }
type: number_integer
region: content
hidden: hidden:
langcode: true langcode: true
search_api_excerpt: true search_api_excerpt: true

View File

@ -0,0 +1,31 @@
uuid: c9cbfb39-2a62-4ec4-8560-914fe2a8676f
langcode: fr
status: true
dependencies:
config:
- field.storage.taxonomy_term.field_weight
- taxonomy.vocabulary.assisted_research
module:
- unique_content_field_validation
third_party_settings:
unique_content_field_validation:
unique: false
unique_text: ''
id: taxonomy_term.assisted_research.field_weight
field_name: field_weight
entity_type: taxonomy_term
bundle: assisted_research
label: Weight
description: ''
required: false
translatable: false
default_value:
-
value: 0
default_value_callback: ''
settings:
min: -20
max: 20
prefix: ''
suffix: ''
field_type: integer

View File

@ -0,0 +1,24 @@
uuid: f7097059-91a6-4e19-9596-e2aa3f22ee5a
langcode: fr
status: true
dependencies:
module:
- field_permissions
- taxonomy
third_party_settings:
field_permissions:
permission_type: public
id: taxonomy_term.field_weight
field_name: field_weight
entity_type: taxonomy_term
type: integer
settings:
unsigned: false
size: normal
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@ -8,8 +8,10 @@ dependencies:
- field.storage.taxonomy_term.field_public_address - field.storage.taxonomy_term.field_public_address
- field.storage.taxonomy_term.field_public_email - field.storage.taxonomy_term.field_public_email
- field.storage.taxonomy_term.field_synonyms - field.storage.taxonomy_term.field_synonyms
- field.storage.taxonomy_term.field_terms
- field.storage.taxonomy_term.field_visuels - field.storage.taxonomy_term.field_visuels
- field.storage.taxonomy_term.field_website - field.storage.taxonomy_term.field_website
- field.storage.taxonomy_term.field_weight
- field.storage.taxonomy_term.field_workflow - field.storage.taxonomy_term.field_workflow
- image.style.medium - image.style.medium
- taxonomy.vocabulary.assisted_research - taxonomy.vocabulary.assisted_research
@ -4586,9 +4588,11 @@ display:
description: '' description: ''
columns: columns:
views_bulk_operations_bulk_form: views_bulk_operations_bulk_form views_bulk_operations_bulk_form: views_bulk_operations_bulk_form
tid: name field_weight: field_weight
name: name name: field_weight
operations: name operations: field_weight
tid: field_weight
field_terms: field_terms
is_locked: is_locked is_locked: is_locked
info: info:
views_bulk_operations_bulk_form: views_bulk_operations_bulk_form:
@ -4596,6 +4600,25 @@ display:
separator: '' separator: ''
empty_column: false empty_column: false
responsive: '' responsive: ''
field_weight:
sortable: true
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: priority-low
name:
sortable: false
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
operations:
align: ''
separator: ''
empty_column: false
responsive: ''
tid: tid:
sortable: false sortable: false
default_sort_order: asc default_sort_order: asc
@ -4603,14 +4626,7 @@ display:
separator: '' separator: ''
empty_column: false empty_column: false
responsive: '' responsive: ''
name: field_terms:
sortable: true
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
operations:
align: '' align: ''
separator: '' separator: ''
empty_column: false empty_column: false
@ -4622,7 +4638,7 @@ display:
separator: '' separator: ''
empty_column: false empty_column: false
responsive: '' responsive: ''
default: '-1' default: field_weight
empty_table: false empty_table: false
defaults: defaults:
style: false style: false
@ -4707,18 +4723,18 @@ display:
preconfiguration: preconfiguration:
label_override: '' label_override: ''
plugin_id: views_bulk_operations_bulk_form plugin_id: views_bulk_operations_bulk_form
tid: field_weight:
id: tid id: field_weight
table: taxonomy_term_field_data table: taxonomy_term__field_weight
field: tid field: field_weight
relationship: none relationship: none
group_type: group group_type: group
admin_label: '' admin_label: ''
label: 'Term ID' label: Weight
exclude: false exclude: false
alter: alter:
alter_text: false alter_text: false
text: '<code style="font-size:8px;">{{tid}}</code>' text: ''
make_link: false make_link: false
path: '' path: ''
absolute: false absolute: false
@ -4734,8 +4750,8 @@ display:
target: '' target: ''
nl2br: false nl2br: false
max_length: 0 max_length: 0
word_boundary: false word_boundary: true
ellipsis: false ellipsis: true
more_link: false more_link: false
more_link_text: '' more_link_text: ''
more_link_path: '' more_link_path: ''
@ -4743,7 +4759,7 @@ display:
trim: false trim: false
preserve_tags: '' preserve_tags: ''
html: false html: false
element_type: code element_type: ''
element_class: '' element_class: ''
element_label_type: '' element_label_type: ''
element_label_class: '' element_label_class: ''
@ -4756,8 +4772,10 @@ display:
empty_zero: false empty_zero: false
hide_alter_empty: true hide_alter_empty: true
click_sort_column: value click_sort_column: value
type: number_unformatted type: number_integer
settings: { } settings:
thousand_separator: ''
prefix_suffix: true
group_column: value group_column: value
group_columns: { } group_columns: { }
group_rows: true group_rows: true
@ -4768,8 +4786,6 @@ display:
multi_type: separator multi_type: separator
separator: ', ' separator: ', '
field_api_classes: false field_api_classes: false
entity_type: taxonomy_term
entity_field: tid
plugin_id: field plugin_id: field
name: name:
id: name id: name
@ -4888,6 +4904,133 @@ display:
destination: false destination: false
entity_type: taxonomy_term entity_type: taxonomy_term
plugin_id: entity_operations plugin_id: entity_operations
tid:
id: tid
table: taxonomy_term_field_data
field: tid
relationship: none
group_type: group
admin_label: ''
label: 'Term ID'
exclude: false
alter:
alter_text: false
text: '<code style="font-size:8px;">{{tid}}</code>'
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: false
ellipsis: false
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: code
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: number_unformatted
settings: { }
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: taxonomy_term
entity_field: tid
plugin_id: field
field_terms:
id: field_terms
table: taxonomy_term__field_terms
field: field_terms
relationship: none
group_type: group
admin_label: ''
label: Terms
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: target_id
type: entity_reference_label
settings:
link: true
group_column: target_id
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: ul
separator: ', '
field_api_classes: false
plugin_id: field
is_locked: is_locked:
id: is_locked id: is_locked
table: content_lock table: content_lock
@ -5105,4 +5248,6 @@ display:
- url - url
- url.query_args - url.query_args
- user.roles - user.roles
tags: { } tags:
- 'config:field.storage.taxonomy_term.field_terms'
- 'config:field.storage.taxonomy_term.field_weight'

View File

@ -60,7 +60,8 @@ class MaterioSapiSearchForm extends FormBase {
// //
// ] // ]
$query = \Drupal::entityQuery('taxonomy_term'); $query = \Drupal::entityQuery('taxonomy_term');
$query->condition('vid', "assisted_research"); $query->condition('vid', "assisted_research")
->sort('field_weight', 'ASC');
$tids = $query->execute(); $tids = $query->execute();
$terms = \Drupal\taxonomy\Entity\Term::loadMultiple($tids); $terms = \Drupal\taxonomy\Entity\Term::loadMultiple($tids);

View File

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"/> <meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/> <meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>materio.com [19 May 2021 at 16:19]</title> <title>materio.com [20 May 2021 at 17:44]</title>
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W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YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" /> <link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFw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