Skip to main content

Detail and recommendations

What you're building: a page that renders one record from Algolia, with a row of related items underneath.

Two separate features that usually appear together. Detail renders one record. Recommendations ask Algolia what else to show.

Detail

  • Applies toA Section wrapping the record

    Marks the detail region.

  • Applies toThe detail wrapper

    Which index to load the record from.

Inside the wrapper, bind fields exactly as in a result card:

<section wf-algolia-element="detail" wf-algolia-index="products">
<h1 wf-algolia-text="name"></h1>
<img wf-algolia-image="hero" wf-algolia-alt="name" />
<div wf-algolia-html="description"></div>
</section>

Which record

The script has to work out which record to load. In order:

  1. — a literal ID on the element
  2. — where to read it from, such as a URL segment or query parameter
  3. — match a field other than objectID

On a Webflow CMS template page the usual approach is to bind the objectID value to a CMS field, so each generated page carries its own.

Three different failures, three different messages
  • Detail page missing wf-algolia-index — no index on the wrapper
  • Detail page: no objectID found in URL or attributes — nothing identified the record
  • Detail page: object not found for — the ID resolved but no record matched

The third usually means the record exists in Webflow but has not synced to Algolia yet.

Repeating fields

For an array field — sizes, tags, related links — mark a wrapper and one child . The item is cloned per entry.

Recommendations

  • Applies toA Section below the detail

    Marks the recommendation region.

  • Applies toThe recommend wrapper

    Which Algolia Recommend model to query.

  • Applies toThe recommend wrapper

    Which index the model was trained on.

  • Applies toA Div inside the wrapper

    Where recommendations render.

A recommendation section needs all four of a model, an index, a grid and a template. Missing any one produces a single console message:

[wf-algolia] recommend section missing model, index, grid, or template

Tuning

  • — how many to show
  • — minimum confidence score
  • and — for trending models scoped to a category
Models must be trained before they return anything

Algolia Recommend learns from traffic. On a new index, or one without Insights events, a correctly built section renders nothing at all. That is the model, not your markup — check Dashboard → Recommend before debugging attributes.

Troubleshooting

SymptomCauseFix
Detail page renders emptyNo objectID could be resolvedCheck the URL and the objectid attributes
object not found forThe record has not synced to AlgoliaRe-run the sync
Recommendations never appearThe model is untrainedCheck Dashboard → Recommend
recommend: unknown modelThe model name is misspelledUse an exact Algolia model name
Only one recommendation showsNo template inside the grid to cloneAdd one