Display list of posts, grouped by year

This commit is contained in:
Oliver Davies 2020-12-16 00:58:44 +00:00
parent f76cc9d98f
commit f0039080e4
2 changed files with 150 additions and 24 deletions

View file

@ -3,7 +3,6 @@ langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
- node.type.post
- system.menu.main
module:
@ -49,37 +48,99 @@ display:
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: mini
type: none
options:
items_per_page: 10
offset: 0
id: 0
total_pages: null
expose:
items_per_page: false
items_per_page_label: 'Items per page'
items_per_page_options: '5, 10, 25, 50'
items_per_page_options_all: false
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
tags:
previous:
next:
style:
type: html_list
options:
grouping:
-
field: created
rendered: true
rendered_strip: true
row_class: ''
default_row_class: true
uses_fields: false
type: ul
wrapper_class: ''
class: space-y-8
wrapper_class: 'min-w-full prose'
class: ''
row:
type: 'entity:node'
type: fields
options:
view_mode: teaser
default_field_elements: true
inline:
title: title
created_1: created_1
separator: ' '
hide_empty: false
fields:
created:
id: created
table: node_field_data
field: created
relationship: none
group_type: group
admin_label: 'Posted year'
label: ''
exclude: true
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: false
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: timestamp
settings:
date_format: custom
custom_date_format: 'Y'
timezone: ''
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: node
entity_field: created
plugin_id: field
title:
id: title
table: node_field_data
@ -127,6 +188,73 @@ display:
multi_type: separator
separator: ', '
field_api_classes: false
created_1:
id: created_1
table: node_field_data
field: created
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: true
text: '({{ created_1 }})'
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: false
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: timestamp
settings:
date_format: medium
custom_date_format: ''
timezone: ''
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: node
entity_field: created
plugin_id: field
filters:
status:
value: '1'
@ -194,7 +322,6 @@ display:
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url.query_args
- 'user.node_grants:view'
- user.permissions
tags: { }
@ -250,7 +377,6 @@ display:
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url.query_args
- 'user.node_grants:view'
- user.permissions
tags: { }

View file

@ -49,7 +49,7 @@
{{ exposed }}
{{ attachment_before }}
<div class="mt-10">
<div class="mt-10 space-y-10">
{% if rows -%}
{{ rows }}
{% elseif empty -%}