From 94175c1df17daffd31a088fb4995019703d8d6a3 Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Tue, 17 Apr 2018 23:00:18 +0200 Subject: [PATCH] added autocomplete with documents title in search form --- .../figli/edlp_search/src/Controller/EdlpSearchController.php | 3 +++ .../all/modules/figli/edlp_search/src/Form/EdlpSearchForm.php | 2 ++ 2 files changed, 5 insertions(+) diff --git a/sites/all/modules/figli/edlp_search/src/Controller/EdlpSearchController.php b/sites/all/modules/figli/edlp_search/src/Controller/EdlpSearchController.php index c62b96bed..99667aab7 100644 --- a/sites/all/modules/figli/edlp_search/src/Controller/EdlpSearchController.php +++ b/sites/all/modules/figli/edlp_search/src/Controller/EdlpSearchController.php @@ -208,6 +208,9 @@ class EdlpSearchController extends ControllerBase { // if($this->request->query->get('field_synonyms')){ $this->field_synonyms = $this->request->query->get('field_synonyms'); // } + // if($this->request->query->get('node_type')){ + // $this->node_type = $this->request->query->get('node_type'); + // } $this->keys = $this->request->query->get('q'); } diff --git a/sites/all/modules/figli/edlp_search/src/Form/EdlpSearchForm.php b/sites/all/modules/figli/edlp_search/src/Form/EdlpSearchForm.php index 7efc94d09..52c4b16e3 100644 --- a/sites/all/modules/figli/edlp_search/src/Form/EdlpSearchForm.php +++ b/sites/all/modules/figli/edlp_search/src/Form/EdlpSearchForm.php @@ -29,6 +29,8 @@ class EdlpSearchForm extends FormBase { '#title' => $this->t('Search'), 'keys' => [ '#type' => 'search', + '#autocomplete_route_name' => 'edlp_search.edlp_search_controller_autocomplete', + '#autocomplete_route_parameters' => array('field_name' => 'title'), '#maxlength' => 20, '#size' => 15, '#weight' => '0',