Skip to main content

List View

The List View page is located at Collections > List View. Select a Collection from the Collections drop-down, then select a Search Profile.

Search Profiles are managed with:

/collections/{collectionCode}/search-profiles/{searchProfileCode}

For example, the following request creates or updates the standard Search Profile for the product-catalog Collection:

PUT {{SOLUTION_URL}}/collections/product-catalog/search-profiles/standard
content-type: application/json
Authorization: Bearer {{API_KEY}}
X-Customer-Code: {{customerCode}}

{
"searchProfile": {
"name": "standard",
"description": "Standard search profile",
"searchableFields": ["product_name"],
"styleMode": "tailwind",
"nameField": "product_name",
"thumbnailHtmlTemplate": "<div class='h-full flex flex-col p-3 rounded-xl border border-transparent hover:border-gray-200 hover:shadow-sm transition'> <div class='aspect-square bg-neutral-100 bg-blend-multiply bg-center bg-contain bg-no-repeat bg-origin-content p-6'{{#if image}} style='background-image: url(\"{{image}}\")'{{/if}}></div> <div class='pt-4 tracking-tight'> <div class='text-sm text-gray-900' title='{{product_name}}'>{{product_name}}</div> <hr class='my-1 border-t border-gray-300' /> <div class='text-sm text-gray-800 truncate'>{{product}}</div> <div class='mt-2 text-sm font-semibold text-gray-900'>{{currency msrp}}</div> {{#if delivery_lead_time}}<div class='mt-1 text-sm text-gray-500 truncate'>Ships in {{delivery_lead_time}}</div>{{/if}} </div></div>",
"detailHtmlTemplate": "<div class='@container tracking-tight text-gray-900'> <div class='grid gap-8 @2xl:grid-cols-2'> <div class='aspect-square rounded-xl bg-neutral-100 bg-blend-multiply bg-center bg-contain bg-no-repeat bg-origin-content p-10'{{#if image}} style='background-image: url(\"{{image}}\")'{{/if}}></div> <div class='flex flex-col'> {{#if brand}}<div class='text-sm font-medium uppercase tracking-widest text-gray-500'>{{brand}}</div>{{/if}} <h3 class='mt-1 text-3xl leading-tight'>{{product_name}}</h3> {{#if product}}<div class='mt-1 text-lg text-gray-700'>{{product}}</div>{{/if}} {{#if msrp}}<div class='mt-4 text-3xl font-semibold'>{{currency msrp}}</div>{{/if}} {{#if product_type}}<div class='mt-3'><span class='inline-block rounded-full bg-gray-100 px-3 py-1 text-xs font-medium text-gray-700'>{{product_type}}</span></div>{{/if}} <dl class='mt-6 divide-y divide-gray-200 border-y border-gray-200 text-sm'> {{#if color}}<div class='flex justify-between gap-4 py-3'><dt class='text-gray-500'>Color</dt><dd class='text-right font-medium'>{{color}}</dd></div>{{/if}} {{#if fabric}}<div class='flex justify-between gap-4 py-3'><dt class='text-gray-500'>Fabric</dt><dd class='text-right font-medium'>{{fabric}}</dd></div>{{/if}} {{#if platform}}<div class='flex justify-between gap-4 py-3'><dt class='text-gray-500'>Platform</dt><dd class='text-right font-medium'>{{platform}}</dd></div>{{/if}} {{#if product_category}}<div class='flex justify-between gap-4 py-3'><dt class='text-gray-500'>Category</dt><dd class='text-right font-medium'>{{product_category}}</dd></div>{{/if}} {{#if product_line}}<div class='flex justify-between gap-4 py-3'><dt class='text-gray-500'>Product line</dt><dd class='text-right font-medium'>{{product_line}}</dd></div>{{/if}} {{#if line}}<div class='flex justify-between gap-4 py-3'><dt class='text-gray-500'>Line</dt><dd class='text-right font-medium'>{{line}}</dd></div>{{/if}} {{#if item}}<div class='flex justify-between gap-4 py-3'><dt class='text-gray-500'>Item #</dt><dd class='text-right font-mono'>{{item}}</dd></div>{{/if}} </dl> </div> </div></div>",
"limit": 12,
"facetProfile": [
{
"field": "msrp",
"title": "MSRP",
"facetType": "range",
"ranges": [
{ "key": "lt_100", "to": 100, "title": "Under $100" },
{ "key": "100_200", "from": 100, "to": 200, "title": "$100 - $200" },
{ "key": "200_300", "from": 200, "to": 300, "title": "$200 - $300" },
{ "key": "300_400", "from": 300, "to": 400, "title": "$300 - $400" },
{ "key": "gte_400", "from": 400, "title": "Over $400" }
]
},
{
"field": "color",
"title": "Color",
"facetType": "term"
},
{
"field": "product_type",
"title": "Product Type",
"facetType": "term"
},
{
"field": "fabric",
"title": "Fabric",
"facetType": "term"
},
{
"field": "line",
"title": "Line",
"facetType": "term"
},
{
"field": "platform",
"title": "Platform",
"facetType": "term"
},
{
"field": "type",
"title": "Type",
"facetType": "term"
},
{
"facetType": "taxonomy",
"taxonomyCollectionCode": "product-catalog-hierarchy",
"title": "Product Hierarchy 2"
}
]
}
}

Search Profile fields​

These Search Profile fields control how records are rendered:

FieldPurpose
thumbnailHtmlTemplateHandlebars template for a record's thumbnail in the results. By default, the thumbnail displays the record's name (see nameField).
detailHtmlTemplateOptional Handlebars template for the Detail tab of the record modal.
nameFieldField containing a record's name. Overrides the collection's @descriptor.nameField; used for default thumbnails and as the modal title. Falls back to the record's _key.
recordStylesCSS for rendered thumbnails and detail.
styleModescoped (default) or tailwind.

Clicking a thumbnail, or pressing Enter while it is focused, opens a modal with a Raw JSON tab. When detailHtmlTemplate is set, the modal also has a Detail tab, which opens first. Detail content is rendered and styled the same way as thumbnails.

Styling modes​

  • scoped: Records render inside a Shadow DOM. recordStyles applies only to the records, and the page's CSS does not reach them. Use plain selectors such as .record { … }. @import is ignored.
  • tailwind: Records render in the page and the Tailwind browser build (/app/vendor/tailwind.browser.js) loads, so templates can use utility classes such as class="text-lg font-semibold". recordStyles is wrapped in @scope (.records, .record-detail) { … }. Tailwind's base styles also apply to the rest of the page once loaded.

Results layout​

Records flow left to right and wrap into as many columns as fit. The minimum column width is 280px, with one column on narrow screens. Only the default thumbnail has a bordered card; a custom thumbnailHtmlTemplate draws its own.

To change the column width, set --record-min-width in recordStyles:

  • In scoped mode: .records { --record-min-width: 360px; }
  • In tailwind mode: :scope { --record-min-width: 360px; } (the CSS is inside @scope (.records)).

Use 100% for one record per row. Cells stretch to the tallest card in their row, so a template whose root has h-full (or height: 100%) fills the cell.

The following tailwind example creates equal-height thumbnails. The image area always reserves a square, and uses a CSS background image, so a missing or broken image displays nothing instead of a broken-image icon. Titles are clamped to two lines and always reserve space for two lines:

<div class="h-full flex flex-col rounded overflow-hidden shadow-lg bg-white">
<div class="aspect-square bg-center bg-contain bg-no-repeat"{{#if image}} style="background-image: url('{{image}}')"{{/if}}></div>
<div class="px-6 py-4">
<div class="font-bold text-xl mb-2 line-clamp-2 min-h-14" title="{{product_name}}">{{product_name}}</div>
<p class="text-gray-700 text-base truncate"><b>Brand:</b> {{brand}}</p>
</div>
</div>

Template sanitization​

Template output is sanitized with DOMPurify. Scripts, event-handler attributes such as onerror= and onclick=, javascript: URLs, and <style> tags are removed. class and style attributes are kept.

Template helpers​

The following helpers are available from src/ui-app/public/js/record-helpers.js:

HelperExampleOutput
currency value [code] [locale]{{currency msrp}}$150.00
number value [decimals] [locale]{{number rating 1}}4.5
date value [full|long|medium|short] [locale]{{date updatedAt "long"}}November 5, 2026
truncate value length [suffix]{{truncate description 80}}First 80 characters followed by …
join array [separator]{{join tags " · "}}Lovesac · Sactional
default value fallback{{default subtitle "n/a"}}n/a when empty
json value<pre>{{json this}}</pre>The record as JSON
eq ne gt gte lt lte and or not includes{{#if (gt msrp 300)}}Premium{{/if}}Helpers for conditional logic

Example Search Profile​

This smaller Search Profile example demonstrates a term facet, custom thumbnail and detail templates, record styles, and a conditional helper:

{
"searchableFields": ["product_name"],
"limit": 12,
"facetProfile": [{ "field": "color", "title": "Color", "facetType": "term" }],
"nameField": "product_name",
"detailHtmlTemplate": "<h2>{{product_name}}</h2><p>{{currency msrp}}</p><pre>{{json this}}</pre>",
"thumbnailHtmlTemplate": "<div class='record'><h3>{{product_name}}</h3><span class='price'>{{currency msrp}}</span>{{#if (includes tags \"Sactional\")}}<span class='badge'>Sactional</span>{{/if}}</div>",
"recordStyles": ".record h3 { margin: 0 0 4px; font-size: 15px; } .price { font-weight: 600; } .badge { margin-left: 8px; padding: 1px 6px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: 12px; }"
}