Skip to content
Snippets Groups Projects
Commit c87c6d1a authored by Mohamed Anis Taktak's avatar Mohamed Anis Taktak
Browse files

Views search snippet worked correctly

parent dd4138a5
Branches
Tags 8.x-1.x-dev
No related merge requests found
uuid: 56e08919-a627-4522-a205-5a6d9e7a1945
uuid: 534c4859-bdc3-4a04-ac08-8bad90f5e45a
langcode: en
status: true
dependencies:
......@@ -9,8 +9,6 @@ dependencies:
- search
- user
- views_search_snippet
_core:
default_config_hash: W3OmRuihkZXwTXpc6tEi6gaf_3IU8hMHoo3Pyxeig8M
id: example_search_result_snippet
label: 'Example search result snippet'
module: views
......@@ -77,158 +75,10 @@ display:
row:
type: fields
options:
default_field_elements: true
default_field_elements: false
inline: { }
separator: ''
hide_empty: false
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
snippet:
id: snippet
table: node_search_index
field: snippet
plugin_id: search_snippet
filters:
status:
value: true
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:
article: article
entity_type: node
entity_field: type
plugin_id: bundle
keys:
id: keys
table: node_search_index
field: keys
relationship: none
group_type: group
admin_label: ''
operator: optional
value: ''
group: 1
exposed: true
expose:
use_operator: false
operator: keys_op
identifier: keys
label: 'Search Keywords'
description: null
remember: false
multiple: false
required: false
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
plugin_id: search_keywords
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: 'Example search result snippet'
header: { }
footer: { }
empty: { }
relationships: { }
arguments: { }
display_extenders: { }
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- url.query_args
- 'user.node_grants:view'
- user.permissions
tags: { }
page_1:
display_plugin: page
id: page_1
display_title: Page
position: 1
display_options:
display_extenders: { }
path: example-search-result-snippet
fields:
title:
id: title
......@@ -333,11 +183,7 @@ display:
format_plural_string: "1\x03@count"
prefix: ''
suffix: ''
plugin_id: search_snippet
defaults:
fields: false
filters: false
filter_groups: false
plugin_id: views_search_snippet
filters:
status:
value: true
......@@ -377,7 +223,7 @@ display:
use_operator: false
operator: keys_op
identifier: keys
required: true
required: false
remember: false
multiple: false
remember_roles:
......@@ -397,10 +243,47 @@ display:
default_group_multiple: { }
group_items: { }
plugin_id: search_keywords
filter_groups:
operator: AND
groups:
1: AND
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: 'Example search result snippet'
header: { }
footer: { }
empty: { }
relationships: { }
arguments: { }
display_extenders: { }
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- url.query_args
- 'user.node_grants:view'
- user.permissions
tags: { }
page_1:
display_plugin: page
id: page_1
display_title: Page
position: 1
display_options:
display_extenders: { }
path: example-search-result-snippet
cache_metadata:
max-age: -1
contexts:
......
<?php
namespace Drupal\search_snippet\Plugin\views\field;
namespace Drupal\views_search_snippet\Plugin\views\field;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\views\Annotation\ViewsField;
use Drupal\views\Plugin\views\field\NumericField;
use Drupal\views\ResultRow;
......@@ -14,7 +15,7 @@ use Drupal\views\ResultRow;
*
* @ingroup views_field_handlers
*
* @ViewsField("search_snippet")
* @ViewsField("views_search_snippet")
*/
class Snippet extends NumericField {
......
......@@ -7,7 +7,7 @@ function views_search_snippet_views_data() {
'title' => t('Snippet'),
'help' => t('A snippet from the content with search keywords highlighted. This will not be used if the search filter is not also present.'),
'field' => array(
'id' => 'search_snippet',
'id' => 'views_search_snippet',
'no group by' => TRUE,
),
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment