diff --git a/config/sync/search_api.index.content.yml b/config/sync/search_api.index.content.yml index 5d8bcc5bb..cb0360234 100644 --- a/config/sync/search_api.index.content.yml +++ b/config/sync/search_api.index.content.yml @@ -6,6 +6,8 @@ dependencies: - field.storage.node.field_branch - field.storage.node.field_categories - field.storage.node.field_publication_date + - field.storage.node.field_subtitle + - field.storage.node.field_teaser_text - search_api.server.db_search module: - node @@ -47,6 +49,22 @@ field_settings: dependencies: config: - field.storage.node.field_publication_date + field_subtitle: + label: Subtitle + datasource_id: 'entity:node' + property_path: field_subtitle + type: text + dependencies: + config: + - field.storage.node.field_subtitle + field_teaser_text: + label: 'Teaser text' + datasource_id: 'entity:node' + property_path: field_teaser_text + type: text + dependencies: + config: + - field.storage.node.field_teaser_text status: label: Published datasource_id: 'entity:node' @@ -59,7 +77,7 @@ field_settings: label: Title datasource_id: 'entity:node' property_path: title - type: string + type: text dependencies: module: - node @@ -84,6 +102,15 @@ processor_settings: aggregated_field: { } custom_value: { } entity_type: { } + ignorecase: + weights: + preprocess_index: -20 + preprocess_query: -20 + all_fields: false + fields: + - field_subtitle + - title + - type language_with_fallback: { } rendered_item: { } tracker_settings: diff --git a/config/sync/search_api.index.events.yml b/config/sync/search_api.index.events.yml index 69280621e..db2e641e8 100644 --- a/config/sync/search_api.index.events.yml +++ b/config/sync/search_api.index.events.yml @@ -45,6 +45,14 @@ field_settings: dependencies: module: - field_inheritance + event_description: + label: 'Event description' + datasource_id: 'entity:eventinstance' + property_path: event_description + type: text + dependencies: + module: + - field_inheritance event_tags: label: 'Event tags' datasource_id: 'entity:eventinstance' @@ -61,6 +69,14 @@ field_settings: dependencies: module: - recurring_events + title: + label: 'Event title' + datasource_id: 'entity:eventinstance' + property_path: title + type: text + dependencies: + module: + - field_inheritance datasource_settings: 'entity:eventinstance': bundles: @@ -74,6 +90,14 @@ processor_settings: aggregated_field: { } custom_value: { } entity_type: { } + ignorecase: + weights: + preprocess_index: -20 + preprocess_query: -20 + all_fields: true + fields: + - event_description + - title language_with_fallback: { } rendered_item: { } tracker_settings: diff --git a/config/sync/views.view.articles.yml b/config/sync/views.view.articles.yml index 4e5a48cfc..9b4f577bf 100644 --- a/config/sync/views.view.articles.yml +++ b/config/sync/views.view.articles.yml @@ -6,6 +6,7 @@ dependencies: - field.storage.node.field_branch - search_api.index.content module: + - better_exposed_filters - search_api - user - views_infinite_scroll @@ -120,7 +121,7 @@ display: automatically_load_content: false initially_load_all_pages: true exposed_form: - type: basic + type: bef options: submit_button: Apply reset_button: false @@ -129,6 +130,34 @@ display: expose_sort_order: true sort_asc_label: Asc sort_desc_label: Desc + text_input_required: 'Select any filter and click on Apply to see results' + text_input_required_format: basic + bef: + general: + autosubmit: true + autosubmit_exclude_textfield: false + autosubmit_textfield_delay: 500 + autosubmit_hide: true + input_required: false + allow_secondary: false + secondary_label: 'Advanced options' + secondary_open: false + reset_button_always_show: false + filter: + search_api_fulltext: + plugin_id: default + advanced: + placeholder_text: '' + rewrite: + filter_rewrite_values: '' + filter_rewrite_values_key: false + collapsible: false + collapsible_disable_automatic_open: false + is_secondary: false + options_show_only_used: false + options_show_only_used_filtered: false + options_hide_when_empty: false + options_show_items_count: false access: type: perm options: @@ -136,7 +165,20 @@ display: cache: type: none options: { } - empty: { } + empty: + area: + id: area + table: views + field: area + relationship: none + group_type: group + admin_label: '' + plugin_id: text + empty: true + content: + value: 'Unfortunately, there were no results for your search. Try using a different search term.' + format: basic + tokenize: false sorts: field_publication_date: id: field_publication_date @@ -232,6 +274,58 @@ display: default_group_multiple: { } group_items: { } reduce_duplicates: false + search_api_fulltext: + id: search_api_fulltext + table: search_api_index_content + field: search_api_fulltext + relationship: none + group_type: group + admin_label: '' + plugin_id: search_api_fulltext + operator: and + value: '' + group: 1 + exposed: true + expose: + operator_id: search_api_fulltext_op + label: Search + description: '' + use_operator: false + operator: search_api_fulltext_op + operator_limit_selection: false + operator_list: { } + identifier: search_api_fulltext + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + local_administrator: '0' + editor: '0' + mediator: '0' + patron: '0' + external_system: '0' + expose_fields: false + placeholder: Søg + searched_fields_id: search_api_fulltext_searched_fields + value_maxlength: 128 + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + parse_mode: terms + min_length: null + fields: { } style: type: default row: @@ -259,6 +353,7 @@ display: contexts: - 'languages:language_content' - 'languages:language_interface' + - url - url.query_args - 'user.node_grants:view' - user.permissions @@ -279,6 +374,7 @@ display: contexts: - 'languages:language_content' - 'languages:language_interface' + - url - url.query_args - 'user.node_grants:view' - user.permissions diff --git a/config/sync/views.view.events.yml b/config/sync/views.view.events.yml index 0ae91853e..1cc56158f 100644 --- a/config/sync/views.view.events.yml +++ b/config/sync/views.view.events.yml @@ -161,7 +161,20 @@ display: cache: type: none options: { } - empty: { } + empty: + area: + id: area + table: views + field: area + relationship: none + group_type: group + admin_label: '' + plugin_id: text + empty: true + content: + value: 'Unfortunately, there were no results for your search. Try using a different search term.' + format: basic + tokenize: false sorts: date: id: date @@ -261,6 +274,58 @@ display: default_group: All default_group_multiple: { } group_items: { } + search_api_fulltext: + id: search_api_fulltext + table: search_api_index_events + field: search_api_fulltext + relationship: none + group_type: group + admin_label: '' + plugin_id: search_api_fulltext + operator: and + value: '' + group: 1 + exposed: true + expose: + operator_id: search_api_fulltext_op + label: Search + description: '' + use_operator: false + operator: search_api_fulltext_op + operator_limit_selection: false + operator_list: { } + identifier: search_api_fulltext + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + local_administrator: '0' + editor: '0' + mediator: '0' + patron: '0' + external_system: '0' + expose_fields: false + placeholder: Søg + searched_fields_id: search_api_fulltext_searched_fields + value_maxlength: 128 + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + parse_mode: terms + min_length: null + fields: { } style: type: default row: @@ -277,7 +342,7 @@ display: preserve_facet_query_args: false query_tags: { } relationships: { } - use_ajax: true + use_ajax: false header: { } footer: { } display_extenders: { } @@ -285,6 +350,7 @@ display: max-age: -1 contexts: - 'languages:language_interface' + - url - url.query_args - user.permissions tags: @@ -305,6 +371,7 @@ display: max-age: -1 contexts: - 'languages:language_interface' + - url - url.query_args - user.permissions tags: diff --git a/web/modules/custom/dpl_search/templates/dpl-search-header.html.twig b/web/modules/custom/dpl_search/templates/dpl-search-header.html.twig index 584390a49..140712419 100644 --- a/web/modules/custom/dpl_search/templates/dpl-search-header.html.twig +++ b/web/modules/custom/dpl_search/templates/dpl-search-header.html.twig @@ -2,7 +2,7 @@
diff --git a/web/themes/custom/novel/novel.theme b/web/themes/custom/novel/novel.theme index 93ca0ebb4..86dd4f04c 100644 --- a/web/themes/custom/novel/novel.theme +++ b/web/themes/custom/novel/novel.theme @@ -293,6 +293,39 @@ function novel_theme_suggestions_select_alter(array &$suggestions, array $variab } } +/** + * Implements hook_theme_suggestions_form_alter(). + */ +function novel_theme_suggestions_form_alter(array &$suggestions, array $variables): void { + $form_id = $variables['element']['#form_id'] ?? NULL; + + if ($form_id) { + $suggestions[] = "form__$form_id"; + } +} + +/** + * Implements hook_theme_suggestions_form_element_alter(). + */ +function novel_theme_suggestions_form_element_alter(array &$suggestions, array $variables): void { + $name = $variables['element']['#name'] ?? NULL; + + if ($name) { + $suggestions[] = "form_element__$name"; + } +} + +/** + * Implements hook_theme_suggestions_input_alter(). + */ +function novel_theme_suggestions_input_alter(array &$suggestions, array $variables): void { + $name = $variables['element']['#name'] ?? NULL; + + if ($name) { + $suggestions[] = "input__$name"; + } +} + /** * Preprocesses rows in a Drupal view to handle the display of event instances. * diff --git a/web/themes/custom/novel/templates/views/facets-item-list--dropdown.html.twig b/web/themes/custom/novel/templates/views/facets-item-list--dropdown.html.twig index 91ed0df50..9d89877b8 100644 --- a/web/themes/custom/novel/templates/views/facets-item-list--dropdown.html.twig +++ b/web/themes/custom/novel/templates/views/facets-item-list--dropdown.html.twig @@ -16,10 +16,10 @@ {%- endif %} -