Discovery Document Types and Pickers

This page describes how the Discovery plugin integrates with CMS document types and pickers. Editors configure plugin components by selecting JCR documents—such as products, categories, or recommendation widgets—using embedded Open UI pickers or wizards. Editors do not need to know or enter Discovery product or category IDs manually.

All picker and wizard interactions are routed through a CMS-side REST endpoint. The Discovery API credentials remain protected and are never exposed to the browser.

ON THIS PAGE

Document types

The following table lists the available document types, their usage, and the associated wizard:

Document typeUsed byWizard
Product Detail Document (brxdis:productDetailDocument)Product Detail, Product Highlight components2-step product wizard
Category Document (brxdis:categoryDocument)Category Grid, Category Highlight components2-step category wizard
Product Recommendation DocumentProduct Recommendation component3-step recommendation wizard
Category Recommendation DocumentCategory Recommendation component3-step recommendation wizard
Global/Personalized Recommendation DocumentGlobal Recommendation component3-step recommendation wizard
Keyword Recommendation DocumentKeyword Recommendation component3-step recommendation wizard

The recommendation wizard is documented in Recommendations & Visual Search. This page focuses on the product and category document wizards and the picker components they use.

Product & category wizards - Dynamic vs. Pinned

Both the product and category wizards use a two-step process. In the first step, editors choose between Dynamic and Pinned modes:

Edit Product wizard with pinned product picker grid

  • Dynamic: The component retrieves the product or category ID from the URL at render time (for example, ?pid= for products or /category/{slug}/cid/{id} or ?cid= for categories). The document does not store a specific item. Use Dynamic mode for template pages that render content based on the current visitor context.
  • Pinned: The editor searches for and selects a specific product or category. The selection is fixed and does not depend on the URL. Use Pinned mode for slots that should always display the same item.

In step 2, the wizard displays a review screen. For Pinned selections, it shows a live product or category card. For Dynamic mode, it explains the runtime URL behavior.

Edit Product review screen with pinned product sample card

Runtime behavior:
If a component's document is not configured, it renders nothing. In Channel Manager preview, a configuration prompt appears. If a Dynamic-mode document cannot find a matching URL parameter, it also renders nothing. The preview displays a warning, but production visitors see an empty slot rather than an error.

The product picker

The product picker provides the search interface for both the product wizard and the Pinned product recommendation flow.

Editors can:

  • Browse categories using the sidebar, or filter the category list by name or ID
  • Search for products by keyword with the search bar
  • Select a product card to highlight it (the ID and title appear in the footer)
  • Confirm the selection with Select →, or cancel with Cancel

The picker stores only a single product ID string. Price, stock, and image data are always retrieved at render time, ensuring up-to-date information.

The category picker

The category picker offers a similar search interface for categories. It is used by the category wizard and by Pinned category recommendation widgets.

Edit Category wizard with pinned category picker list

Live preview fields

Several document types include an inline preview field next to the wizard. Editors can see the result of their selection immediately, without saving the document.

Preview fieldShown onShows
Product Detail PreviewProduct Detail DocumentThumbnail of the selected (or Dynamic-mode) product
Category Product PreviewCategory DocumentLive thumbnail strip, with an adjustable "number of previews" control (0–4)
Recommendation PreviewRecommendation documentsSample thumbnail strip for the configured widget

Edit Category review screen with product sample thumbnails

Preview fields update immediately when the picker or wizard selection changes. Saving the document is not required to see the updated preview.

Adding a picker to your own document type

To allow editors to reference a Discovery product in a custom document type, add an Open UI string field that points to the product picker extension:

/my-product-ref: jcr:primaryType: frontend:plugin caption: 'Featured Product' field: 'myns:productId' plugin.class: 'org.onehippo.cms7.frontend.plugin.field.OpenUiStringFieldPlugin' uiExtension: 'discoveryProductPicker' wicket.id: '${cluster.id}.field'

This field stores the product ID as a plain string. You can access this value in your HST code and use it as needed, such as passing it as contextProductId to a recommendation component or retrieving full product details from your commerce system at render time.

Troubleshooting

SymptomLikely cause
Picker dialog shows blank or fails to loadThe CMS-side plugin module is missing from the classpath or has not started. See Installation.
Picker search returns no resultsDiscovery credentials are missing or incorrect for the channel. See Configuration.
A picked value disappears after reloadThe property backing the field is not declared in your document type's node type definition.
Product preview shows the wrong category's productsThe picker field and the preview field are not in the same document. Live updates only apply to fields within the same open document.
Share Feedback
Page: /build/enterprise-plugins/discovery-plugin/document-types-and-pickers
Section: Build
Category *