‘);
$(this).css(‘min-height’, ’20px’);
const searchBoxRoot = document.getElementById(“searchbox”+index);
Coveo.initSearchbox( searchBoxRoot, ” );
});
$(‘#titleBar .CoveoSearchbox’).hide();
$(‘.coveoSearchButton’).on(“click”,function(){
$(‘#titleBar .CoveoSearchbox’).toggle();
});
// ====== Front Page Search Box ======
$(‘#Form_search’).remove();
var boxes = [“#search-0”, “#search-1”, “#search-2”, “#search-3”, “#search-4”, “#search-5”];
console.log(“PT: Before search box replacement”);
$(boxes).each(function(i, val) {
// ====== Front Page Search Box ======
$(val).each(function( index ) {
console.log(this);
$(‘#searchbox’ + i).remove();
$(this).find(‘form’).remove();
$(this).addClass(‘fpsearchbox’);
$(this).attr(‘id’, ‘fpsearchbox’ + index);
$(this).append(”);
$(this).css(‘min-height’, ’20px’);
const searchBoxRoot = document.getElementById(“fpsearchbox”+index);
var action = “;
if ( $(‘body’).hasClass(‘Categories’)) {
var category=$(‘h1.heading-1’).text();
if (category === “Smartsheet Product Feedback & Ideas”) {
category = encodeURIComponent(category);
Coveo.$(searchBoxRoot).on(‘buildingQuery’, function(e, args) {
args.queryBuilder.advancedExpression.addFieldExpression(‘@communitycategory’, ‘==’, [category]);
});
action = action + ‘#&f:@communitycategory=[‘+category+’]’;
}
}
Coveo.initSearchbox(
searchBoxRoot,
action
);
});
});
});