@eeacms/volto-globalsearch

2.0.0 • Public • Published

volto-globalsearch

Releases

Pipeline Lines of Code Coverage Bugs Duplicated Lines (%)

Pipeline Lines of Code Coverage Bugs Duplicated Lines (%)

EEA Elastic Search Block with NLP integration Volto add-on

Features

Globalsearch

Demo

Getting started

Try volto-globalsearch with Docker

  git clone https://github.com/eea/volto-globalsearch.git
  cd volto-globalsearch
  make
  make start

Go to http://localhost:3000

Add volto-globalsearch to your Volto project

  1. Make sure you have a Plone backend up-and-running at http://localhost:8080/Plone

    docker compose up backend
  2. Start Volto frontend

  • If you already have a volto project, just update package.json:

    "addons": [
        "@eeacms/volto-globalsearch"
    ],
    
    "dependencies": {
        "@eeacms/volto-globalsearch": "*"
    }
  • If not, create one:

    npm install -g yo @plone/generator-volto
    yo @plone/volto my-volto-project --canary --addon @eeacms/volto-globalsearch
    cd my-volto-project
    
  1. Install new add-ons and restart Volto:

    yarn
    yarn start
    
  2. Go to http://localhost:3000

  3. Happy editing!

Customizing the volto-searchblock

Modifying Clusters

To customize the behavior of the volto-searchblock in your volto theme addon, you can modify clusters by following these steps:

  1. Find or create index.js in the src/config

    In your theme addon, create the src/config/index.js file. You can refer to the example file in the volto-marine-theme repository.

  2. Locate and Modify Clusters

    Clusters are found in config.searchui.<name_of_search>.runtime_mappings. For example, in the case of the volto-marine-theme, the <name_of_search> was marinemeasure, and clusters are located in config.searchui.marinemeasure.runtime_mappings.

  3. Use build_runtime_mappings

    You have to pass the clusters transformed by build_runtime_mappings function. Import the build_runtime_mappings as follows:

     import { build_runtime_mappings } from '@eeacms/volto-globalsearch/utils';
  4. Default Clusters

    Default clusters are defined here. Decide whether you want to override all clusters or modify specific ones. If you decided to modify them, you can import them in your addon as follows:

    import { clusters } from '@eeacms/volto-globalsearch/config/clusters';
  5. Example Modification

    Here's an example of how the Publications cluster was modified in the CountryFactsheet by keeping the rest as default: https://github.com/eea/volto-marine-theme/pull/43/files.

  6. Cluster Structure

    Be aware that a cluster contains the values key that holds the content types on which the cluster will act.

Release

See RELEASE.md.

How to contribute

See DEVELOP.md.

Copyright and license

The Initial Owner of the Original Code is European Environment Agency (EEA). All Rights Reserved.

See LICENSE.md for details.

Funding

European Environment Agency (EU)

Package Sidebar

Install

npm i @eeacms/volto-globalsearch

Weekly Downloads

403

Version

2.0.0

License

MIT

Unpacked Size

686 kB

Total Files

87

Last publish

Collaborators

  • nileshgulia1
  • valentinab25
  • demarant
  • avoinea
  • tiberiuichim
  • zotya
  • alecghica
  • eea-jenkins
  • razvan.miu
  • ichimdav