Replies: 1 comment
-
Yes, that's code that will be evaluated for the specific widget, so you can do something like this: fallbackWidget: ({ container, attribute }) => {
return panel({ templates: {
header: attribute === 'price' ? 'price for products' : attribute,
collapseButtonText,
},
hidden(options) {
return options.items.length === 0;
},
collapsed: function() { return false; },
})
(refinementList)({ container, attribute,})
}, Or if you have a specific mapping: const mapping = {
price: 'Price for products',
brand: 'Brands'
}
// ...
fallbackWidget: ({ container, attribute }) => {
return panel({ templates: {
header: mapping[attribute] || attribute,
collapseButtonText,
},
hidden(options) {
return options.items.length === 0;
},
collapsed: function() { return false; },
})
(refinementList)({ container, attribute,})
}, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can we put condition for header title in this fallbackwidget
for eg. if facet is "price" then its header is printed as "Price for products"
Beta Was this translation helpful? Give feedback.
All reactions