@coveops/have-you-tried
v1.0.0
Published
When you have no results, have you tried will show machine learning query suggestions to try.
Downloads
3
Maintainers
Keywords
Readme
have-you-tried
When you have no results, have you tried will show machine learning query suggestions to try.
Disclaimer: This component was built by the community at large and is not an official Coveo JSUI Component. Use this component at your own risk.
Getting Started
- Install the component into your project.
npm i @coveops/have-you-tried
- Use the Component or extend it
Typescript:
import { HaveYouTried, IHaveYouTriedOptions } from '@coveops/have-you-tried';
Javascript
const have-you-tried = require('@coveops/have-you-tried').HaveYouTried;
- You can also expose the component alongside other components being built in your project.
export * from '@coveops/have-you-tried'
- Include the component in your template as follows:
<div class="CoveoHaveYouTried"></div>
Options
The following options can be configured:
| Option | Required | Type | Default | Notes |
| --- | --- | --- | --- | --- |
| title
| No | string | <b>No results?</b> You can also try:
| Title rendered |
Extending
Extending the component can be done as follows:
import { HaveYouTried, IHaveYouTriedOptions } from "@coveops/have-you-tried";
export interface IExtendedHaveYouTriedOptions extends IHaveYouTriedOptions {}
export class ExtendedHaveYouTried extends HaveYouTried {}
The following methods can be extended to provide additional functionalities or handle more complex use cases.
applyCommunityUrlRewriter
protected renderTitle():string
The renderTitle
should render the title for the component.
Contribute
- Clone the project
- Copy
.env.dist
to.env
and update the COVEO_ORG_ID and COVEO_TOKEN fields in the.env
file to use your Coveo credentials and SERVER_PORT to configure the port of the sandbox - it will use 8080 by default. - Build the code base:
npm run build
- Serve the sandbox for live development
npm run serve