projects / org / contextualcode / ezplatform-group-search-bundle
Find the Exponential Software extensions you want
| UNIX name | Owner | Status |
|---|---|---|
| ezplatform-group-search-bundle | Contextual Code | stable |
| Version | Compatible with |
|---|---|
| N/A | N/A |
This bundle contains a base implementation of user search in multiple groups.
Be aware that this package overrides default eZ Platform Solr services to support highlights.
If you have these classes override in your project, make sure you have this
```yaml
ezpublish.search.solr.gateway.native.class: ContextualCode\GroupSearchBundle\eZ\Solr\Gateway\Native
ezpublish.search.solr.result_extractor.native.class: ContextualCode\GroupSearchBundle\eZ\Solr\NativeResultExtractor
```
Include this bundle in your composer.json:
{
"require": {
"contextualcode/ezplatform-group-search-bundle": "dev-master"
},
"repositories": [
{
"type": "vcs",
"url": "[email protected]:contextualcode/ezplatform-group-search-bundle.git"
}
]
}
Enable this bundle in app/AppKernel.php:
public function registerBundles()
{
$bundles = [
...,
new ContextualCode\GroupSearchBundle\ContextualCodeGroupSearchBundle(),
];
}
Make sure to add these lines to app/config/routing.yml:
group_search_routes:
resource: "@ContextualCodeGroupSearchBundle/Resources/config/routing.yml"
(optional) To use JS part from the package, register entrypoint in webpack.config.js:
Encore.addEntry('group_search', './vendor/contextualcode/ezplatform-group-search-bundle/src/ContextualCode/GroupSearchBundle/Resources/public/standard/group-search.js');
Then Run encore:
yarn encore [dev|prod]
And include in template:
{{ encore_entry_script_tags('group_search') }}
(optional) Define ezsettings.default.contextualcode.group_search.groups_definition parameter.
Default configuration:
ezsettings.default.contextualcode.group_search.groups_definition:
general:
title: Search Results
no_results_message: '- No related pages found for {term}
'
exclude_content_types: ['image', 'user', 'user_group']
max_count: 25
parent_location_path: /1/2/
images:
title: Images
no_results_message: '- No Images found for {term}
'
include_content_types: ['image']
max_count: 10
parent_location_path: /1/43/
In template, render search input block. For example: