Skip to main content

Recommendation Section

Add toDiv / container

Role attribute

Every instance of this component carries:

Add this attribute
Namewf-algolia-element
Valuerecommend
Required2 attributes
ModelRequired

Recommend model id (e.g. "related-products").

Accepts related-products · frequently-bought-together · looking-similar · trending-items · trending-facets · recommended-for-youDefault related-products

IndexRequired

Algolia index queried by the Recommend call.

Accepts e.g. acme_blog_prod

Optional11 attributes
Object ID field

Read seed objectID from a field on the page.

Object ID from

Set to "path" to read the seed objectID from the URL path (last segment).

Accepts e.g. path

Object ID value

Static seed objectID for the recommend call.

Accepts e.g. abc123

Max results

Cap on the number of recommendations rendered.

Accepts min 1, whole numbers

Threshold

Minimum confidence score (0–100) a recommendation must clear; out-of-range values are ignored.

Accepts min 0, max 100, whole numbers

Facet name

Facet to scope/return: optional on trending-items (pair with -facet-value), required on trending-facets.

Accepts e.g. brand

Facet value

Facet value used with trending-items; must be paired with wf-algolia-facet-name or both are ignored.

Accepts e.g. acme

User token

User token for recommended-for-you; a literal token or "cookie:NAME" to read it from a cookie.

Accepts e.g. cookie:_ALGOLIA

Object IDs

Comma-separated seed objectIDs for multi-seed recommendations (each objectID bills as one request).

Accepts e.g. SKU1, SKU2

Query filters

An Algolia filters string applied to the primary recommend query (queryParameters.filters); ignored on trending-facets (that model accepts no queryParameters).

Accepts e.g. in_stock:true

Fallback filters

An Algolia filters string for the fallback query (fallbackParameters.filters); not supported on FBT.

Accepts e.g. in_stock:true

Elements inside it

These roles are placed inside this component, not on their own:

recommend
└─ recommend-grid
  • — Container inside a recommend scope the recommendation cards render into.