I am trying to show a promo image when the input value contains:“promo”
Rule:
{
“conditions”: [
{
“anchoring”: “contains”,
“pattern”: “promo”,
“alternatives”: true
}
],
“consequence”: {
“userData”: {
“title”: “Promo Title”,
“link”: “www.test.com”
},
“filterPromotes”: true
},
“enabled”: true,
“objectID”: “ar-165350412345”
}
Script
search.addWidget(
instantsearch.widgets.queryRuleCustomData({
container: ‘#queryRuleCustomData’,
templates: {
default: {{#items}} {{#banner}} <section> <h2>{{title}}</h2> <h3>{{link}}</h3> </section> {{/banner}} {{/items}}
,
}
})
);