renderingContent
'renderingContent' => array
Can be used in these methods:
setSettings
set_settings
setSettings
set_settings
setSettings
setSettings
SetSettings
setSettings
SetSettings
setSettings
About this parameter
Defines how you want to render results in the search interface.
You can set a default with setSettings
and override it with Rules.
facetOrdering
. Controls the order of facets in your UI.values
. Controls the order and visibility of specific facet values withorder
andhide
properties.sortRemainingBy
. Determines how to sort remaining values if a facet value isn’t specified. It can be one of:alpha
sorts by facet value, alphabetically in ascending ordercount
sorts by facet value count, numerically in descending orderhidden
hides facet values that aren’t included in thevalues
list.
widgets
. Controls the configuration of specific InstantSearch widgets in your UI. You can’t set this property with thesetSettings
method. Use Rules instead.banners
. Determines how InstantSearch may display any banner configured by Rules. If this property is populated, theHits
widget orInfiniteHits
widget displays a banner by default.
Usage notes
InstantSearch uses this property to define the UI through configuration—for example, with the dynamicWidgets
widget.
If you’re not using InstantSearch for your frontend, you can build a UI with renderingContent
Examples
Set renderingContent
The following example snippet uses renderingContent
to define how results are displayed:
brand
ordering starts with “uniqlo”, never shows the value “muji”, and all other facet values, such as “timberland”, are sorted by facet value count.- The
size
ordering sequence is “S”, “M”, and “L” and other facet values, such as “XS”, are hidden.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$index->setSettings([
'renderingContent' => [
'facetOrdering' => [
'facets' => [
'order' => ['size', 'brand']
],
'values' => [
'brand'=> [
'order' => ['uniqlo'],
'hide' => ['muji'],
'sortRemainingBy' => 'count'
],
'size'=> [
'order' => ['S', 'M', 'L'],
'sortRemainingBy' => 'hidden'
],
]
]
]
]);