Search Widgets Common Data Attributes & Hook Functions
Name | Mandatory | Type | Description |
---|---|---|---|
data-app | Yes | String | Title of desired widget. Should be "search-app". Example: data-app="search-app" |
data-app-id | No | String | Unique algolia application identifier. It's used to identify you when using Algolia's API. Example: data-app-id="K5K87EHRJP" |
data-api-key | No | String | Public algolia API key which is usable for search queries and it's also able to list the indices. Example: data-api-key="ca64bbc3e020872a8bdf4s" |
data-affiliate-id | Yes | String | Title of special widget's view user wants to insert. Represent widget type. There are several views: input-search |
data-css-mode | No | String | The CSS to be applied to the widget. Valid values are: full. This will display the widget with full "out-of-the-box" recommended styling. For example: input-search-full grid - This will display the widget without colours and aesthetic styling, but retain the general layout of the widget. For example: input-search-grid min - This will display the widget without any CSS (ideal for applying your own custom styling). For example: input-search-min Note: "full" is used by default, if no CSS mode is specified. |
data-index-nam | No | String | Identifier of the algolia index name which will be the search for products/venues or etc. input-search-index Right now for developer's purposes "products" are used. For the production environment will be used: prod_products data-index-name="products" |
data-pre-filter | No | String | Object type which is used for the filtering result events. Will be added in search query. Can include multiple object types. Examples: data-object-type="PRD" data-object-type="PRD,VEN" data-object-type="*" |
data-object-subtype | No | String | Object sub type which is used for the filtering result events. Will be added in search query. Can include multiple object sub types. Examples: data-object-subtype="SHW" data-object-subtype="SHW,ATT" data-object-subtype="*" Note: data-object-subtype can be ignored when data-object-type has more than 1 value or [empty string] |
data-limit-results | No | String (number) | The max number of returned results. Default value: 30 Valid values are: numeric value x, where 1 < x < 30 note: if value not valid it will be default value: 30 Example: data-limit-results="10" |
data-action-url | No | String | Used to replace the base url of a search result item url. |
Hook Functions
To override specific functionality you can use hook functions that you can attach to EncoreSearch global object.
Name | Arguments | Return value | Description |
---|---|---|---|
override Item RedirectUrl | objectId: string, | String | Function to override original item redirect url depends on item properties Example: window.EncoreSearch.overrideItemRedirectUrl = function ( |
Updated 14 days ago