From 83d0ffaab8f457d4ef162ffefe159649142fb050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Wed, 2 Oct 2019 14:48:52 -0400 Subject: [PATCH 1/5] Add a per-user blog view like D7 used to have Borrowing from https://git.drupalcode.org/project/blog/blob/8.x-2.x/config/install/views.view.blog.yml Ref #53 --- config/sync/views.view.blogs.yml | 292 +++++++++++++++++++++++++++++++ 1 file changed, 292 insertions(+) create mode 100644 config/sync/views.view.blogs.yml diff --git a/config/sync/views.view.blogs.yml b/config/sync/views.view.blogs.yml new file mode 100644 index 0000000..65262c4 --- /dev/null +++ b/config/sync/views.view.blogs.yml @@ -0,0 +1,292 @@ +uuid: f1150168-75a5-4f36-9442-7e4a6024649e +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - node.type.blog + module: + - node + - user +id: blogs +label: Blogs +module: views +description: 'Old-style per-user (not per-author/person) blog listings.' +tag: '' +base_table: node_field_data +base_field: nid +core: 8.x +display: + default: + display_plugin: default + id: default + display_title: Master + position: 0 + display_options: + access: + type: perm + options: + perm: 'access content' + cache: + type: tag + options: { } + query: + type: views_query + options: + disable_sql_rewrite: false + distinct: false + replica: false + query_comment: '' + query_tags: { } + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + pager: + type: full + options: + items_per_page: 20 + offset: 0 + id: 0 + total_pages: null + tags: + previous: ‹‹ + next: ›› + first: '« First' + last: 'Last »' + 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 + quantity: 9 + style: + type: default + row: + type: 'entity:node' + options: + view_mode: teaser + fields: + title: + id: title + table: node_field_data + field: title + entity_type: node + entity_field: title + label: '' + alter: + alter_text: false + make_link: false + absolute: false + trim: false + word_boundary: false + ellipsis: false + strip_tags: false + html: false + hide_empty: false + empty_zero: false + settings: + link_to_entity: true + plugin_id: field + relationship: none + group_type: group + admin_label: '' + exclude: 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_alter_empty: true + click_sort_column: value + type: string + 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 + filters: + status: + value: '1' + table: node_field_data + field: status + plugin_id: boolean + entity_type: node + entity_field: status + id: status + expose: + operator: '' + group: 1 + type: + id: type + table: node_field_data + field: type + value: + blog: blog + entity_type: node + entity_field: type + plugin_id: bundle + sorts: + created: + id: created + table: node_field_data + field: created + order: DESC + entity_type: node + entity_field: created + plugin_id: date + relationship: none + group_type: group + admin_label: '' + exposed: false + expose: + label: '' + granularity: second + title: Blogs + header: { } + footer: { } + empty: { } + relationships: { } + arguments: { } + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } + feed_1: + display_plugin: feed + id: feed_1 + display_title: Feed + position: 2 + display_options: + display_extenders: { } + row: + type: node_rss + pager: + type: some + style: + type: rss + path: blogs/feed + displays: + default: default + page_1: page_1 + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - 'user.node_grants:view' + - user.permissions + tags: { } + page_all: + display_plugin: page + id: page_all + display_title: 'Blogs page' + position: 1 + display_options: + display_extenders: { } + path: blogs + display_description: 'All blog posts by all users.' + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } + page_user: + display_plugin: page + id: page_user + display_title: 'User blogs' + position: 3 + display_options: + display_extenders: { } + arguments: + uid: + id: uid + table: users_field_data + field: uid + relationship: uid + group_type: group + admin_label: 'author' + default_action: 'not found' + exception: + value: all + title_enable: false + title: All + title_enable: true + title: '{{ arguments.uid }}''s blog' + default_argument_type: fixed + default_argument_options: + argument: '' + default_argument_skip_url: false + summary_options: + base_path: '' + count: true + items_per_page: 25 + override: false + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: false + validate: + type: none + fail: 'not found' + validate_options: { } + break_phrase: false + not: false + entity_type: node + entity_field: uid + plugin_id: numeric + defaults: + arguments: false + relationships: false + relationships: + id: uid + table: node_field_data + field: uid + relationship: none + group_type: group + admin_label: author + required: false + entity_type: node + entity_field: uid + plugin_id: standard + path: blogs/% + display_description: 'Blog posts listings for each user.' + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } From ada214a995dc83369d52add477acac8574ea1931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Wed, 2 Oct 2019 14:56:24 -0400 Subject: [PATCH 2/5] Fix mis-calles of user as node --- config/sync/views.view.blogs.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/sync/views.view.blogs.yml b/config/sync/views.view.blogs.yml index 65262c4..1232ccf 100644 --- a/config/sync/views.view.blogs.yml +++ b/config/sync/views.view.blogs.yml @@ -176,9 +176,9 @@ display: - 'user.node_grants:view' - user.permissions tags: { } - feed_1: + feed_all: display_plugin: feed - id: feed_1 + id: feed_all display_title: Feed position: 2 display_options: @@ -261,9 +261,9 @@ display: validate_options: { } break_phrase: false not: false - entity_type: node + entity_type: user entity_field: uid - plugin_id: numeric + plugin_id: user_uid defaults: arguments: false relationships: false From dde3acee3c5cc29de2e3ea87ef83d70d1a6d5f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Wed, 2 Oct 2019 17:07:46 -0400 Subject: [PATCH 3/5] OK; this view works for UIDs, now to try to make it work for usernames Generating path aliases for all these seems ill-advised, many won't have data, so why create the path? --- config/sync/views.view.blogs.yml | 42 ++++++++++++-------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/config/sync/views.view.blogs.yml b/config/sync/views.view.blogs.yml index 1232ccf..817029b 100644 --- a/config/sync/views.view.blogs.yml +++ b/config/sync/views.view.blogs.yml @@ -226,24 +226,30 @@ display: position: 3 display_options: display_extenders: { } + path: blogs/% + display_description: 'Blog posts listings for each user.' + relationships: { } + defaults: + relationships: false + arguments: false arguments: uid: id: uid - table: users_field_data + table: node_field_data field: uid - relationship: uid + relationship: none group_type: group - admin_label: 'author' - default_action: 'not found' + admin_label: '' + default_action: default exception: value: all title_enable: false title: All - title_enable: true - title: '{{ arguments.uid }}''s blog' - default_argument_type: fixed + title_enable: false + title: '' + default_argument_type: user default_argument_options: - argument: '' + user: false default_argument_skip_url: false summary_options: base_path: '' @@ -261,25 +267,9 @@ display: validate_options: { } break_phrase: false not: false - entity_type: user + entity_type: node entity_field: uid - plugin_id: user_uid - defaults: - arguments: false - relationships: false - relationships: - id: uid - table: node_field_data - field: uid - relationship: none - group_type: group - admin_label: author - required: false - entity_type: node - entity_field: uid - plugin_id: standard - path: blogs/% - display_description: 'Blog posts listings for each user.' + plugin_id: numeric cache_metadata: max-age: -1 contexts: From 96a65b1da6e80263c835b916b96535455440150b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Wed, 2 Oct 2019 17:36:45 -0400 Subject: [PATCH 4/5] OK really don't nkow what i'm doing here and neitherdoes the internet --- config/sync/views.view.blogs.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/config/sync/views.view.blogs.yml b/config/sync/views.view.blogs.yml index 817029b..6c42022 100644 --- a/config/sync/views.view.blogs.yml +++ b/config/sync/views.view.blogs.yml @@ -228,7 +228,18 @@ display: display_extenders: { } path: blogs/% display_description: 'Blog posts listings for each user.' - relationships: { } + relationships: + uid: + id: uid + table: node_field_data + field: uid + relationship: none + group_type: group + admin_label: author + required: false + entity_type: node + entity_field: uid + plugin_id: standard defaults: relationships: false arguments: false From 59cf8b1dd44ee74faefe1046a6ff6a6d4253b9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Wed, 2 Oct 2019 17:47:53 -0400 Subject: [PATCH 5/5] Improve display of blog teasers --- ...re.entity_view_display.node.blog.teaser.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/config/sync/core.entity_view_display.node.blog.teaser.yml b/config/sync/core.entity_view_display.node.blog.teaser.yml index b5b50a4..30b956c 100644 --- a/config/sync/core.entity_view_display.node.blog.teaser.yml +++ b/config/sync/core.entity_view_display.node.blog.teaser.yml @@ -10,9 +10,11 @@ dependencies: - field.field.node.blog.field_body_paragraph - field.field.node.blog.field_image - field.field.node.blog.field_meta_tags + - field.field.node.blog.field_publication_date - field.field.node.blog.field_summary - field.field.node.blog.field_tags - field.field.node.blog.field_topics + - field.field.node.blog.field_upload - node.type.blog - responsive_image.styles.narrow module: @@ -37,6 +39,8 @@ third_party_settings: link_custom: '' classes: layout_class: { } + left: { } + right: { } regions: left: - field_image @@ -45,7 +49,6 @@ third_party_settings: - node_title - field_authors - field_summary - - field_topics fields: node_post_date: plugin_id: node_post_date @@ -83,7 +86,9 @@ content: settings: responsive_image_style: narrow image_link: content - third_party_settings: { } + third_party_settings: + ds: + ds_limit: '1' region: left field_summary: type: text_default @@ -92,14 +97,6 @@ content: settings: { } third_party_settings: { } region: right - field_topics: - type: entity_reference_label - weight: 5 - region: right - label: visually_hidden - settings: - link: true - third_party_settings: { } hidden: body: true comment: true @@ -112,6 +109,7 @@ hidden: field_publication_date: true field_regions: true field_tags: true + field_topics: true field_upload: true field_visions_models: true links: true