I've been asked to disable the card view for a search result page. I know nothing about Coveo, but i have determined that for mobile the list view is prefered over card view. This is being implemented in a AEM 6.3 template.
In CoveoJsSearch.js, starting at line 17728 I have the following:
if (merged.responsiveComponents.isSmallScreenWidth()) {
templates = _.filter(templates, function (tmpl) { return tmpl.layout == 'card'; });
merged.currentLayout = 'list';
this.layout = 'list';
}
I changed these to list from card and it does what i want, but this looks JS file looks like it's 'compiled' from the front end framework. So what is the best way to ensure mobile users see a list view rather than a card view for search results.
Coveo now provides easy control for this through your search page template:
https://connect.coveo.com/s/article/13748
So for your case (showing list view only at mobile), you'd likely want: