sort articles by field_date
This commit is contained in:
parent
cf3fc3eb31
commit
1ea234644e
|
@ -10,7 +10,7 @@ field_name: field_date
|
||||||
entity_type: node
|
entity_type: node
|
||||||
type: daterange
|
type: daterange
|
||||||
settings:
|
settings:
|
||||||
datetime_type: datetime
|
datetime_type: allday
|
||||||
module: datetime_range
|
module: datetime_range
|
||||||
locked: false
|
locked: false
|
||||||
cardinality: 1
|
cardinality: 1
|
||||||
|
|
|
@ -4,6 +4,7 @@ status: true
|
||||||
dependencies:
|
dependencies:
|
||||||
config:
|
config:
|
||||||
- field.storage.node.field_attachments
|
- field.storage.node.field_attachments
|
||||||
|
- field.storage.node.field_date
|
||||||
- field.storage.node.field_distributor
|
- field.storage.node.field_distributor
|
||||||
- field.storage.node.field_index
|
- field.storage.node.field_index
|
||||||
- field.storage.node.field_linked_articles
|
- field.storage.node.field_linked_articles
|
||||||
|
@ -33,6 +34,7 @@ dependencies:
|
||||||
- better_exposed_filters
|
- better_exposed_filters
|
||||||
- computed_field
|
- computed_field
|
||||||
- content_lock
|
- content_lock
|
||||||
|
- date_range_formatter
|
||||||
- file
|
- file
|
||||||
- image
|
- image
|
||||||
- materio_samples
|
- materio_samples
|
||||||
|
@ -5138,7 +5140,7 @@ display:
|
||||||
delta_offset: 0
|
delta_offset: 0
|
||||||
delta_reversed: false
|
delta_reversed: false
|
||||||
delta_first_last: false
|
delta_first_last: false
|
||||||
multi_type: separator
|
multi_type: ul
|
||||||
separator: ', '
|
separator: ', '
|
||||||
field_api_classes: false
|
field_api_classes: false
|
||||||
plugin_id: field
|
plugin_id: field
|
||||||
|
@ -5268,6 +5270,75 @@ display:
|
||||||
separator: ', '
|
separator: ', '
|
||||||
field_api_classes: false
|
field_api_classes: false
|
||||||
plugin_id: field
|
plugin_id: field
|
||||||
|
field_date:
|
||||||
|
id: field_date
|
||||||
|
table: node__field_date
|
||||||
|
field: field_date
|
||||||
|
relationship: none
|
||||||
|
group_type: group
|
||||||
|
admin_label: ''
|
||||||
|
label: Date
|
||||||
|
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: value
|
||||||
|
type: date_range_without_time
|
||||||
|
settings:
|
||||||
|
timezone_override: ''
|
||||||
|
single: 'd F Y'
|
||||||
|
single_all_day: 'd F Y'
|
||||||
|
one_day: 'd F Y'
|
||||||
|
one_month: 'd - {d} F Y'
|
||||||
|
several_months: 'd F - {d} {F} Y'
|
||||||
|
several_years: 'd F Y - {d} {F} {Y}'
|
||||||
|
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
|
||||||
|
plugin_id: field
|
||||||
field_workflow:
|
field_workflow:
|
||||||
id: field_workflow
|
id: field_workflow
|
||||||
table: node__field_workflow
|
table: node__field_workflow
|
||||||
|
@ -5877,11 +5948,13 @@ display:
|
||||||
field_thesaurus: field_thesaurus
|
field_thesaurus: field_thesaurus
|
||||||
field_tags: field_tags
|
field_tags: field_tags
|
||||||
field_linked_materials: field_linked_materials
|
field_linked_materials: field_linked_materials
|
||||||
|
field_showroom: field_showroom
|
||||||
field_workflow: field_workflow
|
field_workflow: field_workflow
|
||||||
field_migration: field_migration
|
field_migration: field_migration
|
||||||
created: created
|
created: created
|
||||||
changed: changed
|
changed: changed
|
||||||
field_memo: field_memo
|
field_memo: field_memo
|
||||||
|
field_date: field_date
|
||||||
info:
|
info:
|
||||||
views_bulk_operations_bulk_form:
|
views_bulk_operations_bulk_form:
|
||||||
align: ''
|
align: ''
|
||||||
|
@ -5927,6 +6000,13 @@ display:
|
||||||
separator: ''
|
separator: ''
|
||||||
empty_column: false
|
empty_column: false
|
||||||
responsive: ''
|
responsive: ''
|
||||||
|
field_showroom:
|
||||||
|
sortable: false
|
||||||
|
default_sort_order: asc
|
||||||
|
align: ''
|
||||||
|
separator: ''
|
||||||
|
empty_column: false
|
||||||
|
responsive: ''
|
||||||
field_workflow:
|
field_workflow:
|
||||||
sortable: false
|
sortable: false
|
||||||
default_sort_order: asc
|
default_sort_order: asc
|
||||||
|
@ -5962,6 +6042,13 @@ display:
|
||||||
separator: ''
|
separator: ''
|
||||||
empty_column: false
|
empty_column: false
|
||||||
responsive: ''
|
responsive: ''
|
||||||
|
field_date:
|
||||||
|
sortable: true
|
||||||
|
default_sort_order: desc
|
||||||
|
align: ''
|
||||||
|
separator: ''
|
||||||
|
empty_column: false
|
||||||
|
responsive: ''
|
||||||
default: '-1'
|
default: '-1'
|
||||||
empty_table: false
|
empty_table: false
|
||||||
row:
|
row:
|
||||||
|
@ -5977,6 +6064,7 @@ display:
|
||||||
- 'user.node_grants:view'
|
- 'user.node_grants:view'
|
||||||
- user.roles
|
- user.roles
|
||||||
tags:
|
tags:
|
||||||
|
- 'config:field.storage.node.field_date'
|
||||||
- 'config:field.storage.node.field_linked_materials'
|
- 'config:field.storage.node.field_linked_materials'
|
||||||
- 'config:field.storage.node.field_memo'
|
- 'config:field.storage.node.field_memo'
|
||||||
- 'config:field.storage.node.field_migration'
|
- 'config:field.storage.node.field_migration'
|
||||||
|
|
|
@ -11,6 +11,7 @@ dependencies:
|
||||||
- node.type.article
|
- node.type.article
|
||||||
- system.menu.header
|
- system.menu.header
|
||||||
module:
|
module:
|
||||||
|
- datetime
|
||||||
- datetime_range
|
- datetime_range
|
||||||
- image
|
- image
|
||||||
- node
|
- node
|
||||||
|
@ -759,6 +760,19 @@ display:
|
||||||
reduce_duplicates: false
|
reduce_duplicates: false
|
||||||
plugin_id: workflow_state
|
plugin_id: workflow_state
|
||||||
sorts:
|
sorts:
|
||||||
|
field_date_value:
|
||||||
|
id: field_date_value
|
||||||
|
table: node__field_date
|
||||||
|
field: field_date_value
|
||||||
|
relationship: none
|
||||||
|
group_type: group
|
||||||
|
admin_label: ''
|
||||||
|
order: DESC
|
||||||
|
exposed: false
|
||||||
|
expose:
|
||||||
|
label: ''
|
||||||
|
granularity: day
|
||||||
|
plugin_id: datetime
|
||||||
created:
|
created:
|
||||||
id: created
|
id: created
|
||||||
table: node_field_data
|
table: node_field_data
|
||||||
|
|
|
@ -37,6 +37,7 @@ class ComputedArticlesReferences extends EntityReferenceFieldItemList
|
||||||
protected function computeValue() {
|
protected function computeValue() {
|
||||||
$query = \Drupal::entityQuery('node')
|
$query = \Drupal::entityQuery('node')
|
||||||
->condition('status', 1)
|
->condition('status', 1)
|
||||||
|
->sort('field_date', 'DESC')
|
||||||
->sort('created', 'DESC')
|
->sort('created', 'DESC')
|
||||||
->exists('field_visuel')
|
->exists('field_visuel')
|
||||||
->range(0,12)
|
->range(0,12)
|
||||||
|
|
Loading…
Reference in New Issue