Gravatar for abuteau@coveo.com

Question by abuteau, Jun 23, 2014 1:28 PM

Is there a way to remove the custom facets icon in Search MVC

(I'm sure there's one)

Hi guys,

I figure out to "remove" the icon by overriding the CSS rule as stated here: https://developers.coveo.com/display/public/SC201406/Customizing+Facet+Icons

However I'd like to completly remove the icon by removing the div class in the HTML.

I'm in the Search Page MVC and I wonder if it's possible.

Thanks,

2 Replies
Gravatar for vseguin@coveo.com

Answer by Vincent Séguin, Jun 23, 2014 1:44 PM

What about a display:none in your CSS? You could create a rule like that :

.CoveoFacet[data-id='MyFacetId'] .coveo-header > .coveo-icon {
    display:none;
}

where 'MyFacetId' is the Unique Id set by the Page Editor.

Gravatar for abuteau@coveo.com

Comment by abuteau, Jun 23, 2014 1:55 PM

Worked. Thanks Vincent !

Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Jun 23, 2014 1:32 PM

The div itself is created by the JSUI. The only way I think would be to override some parts of the prototype of the facet component. I don't know this code at all and cannot give you more details about this. It would be a big modification I think.

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Jun 23, 2014 1:50 PM

The method that creates the icon div is Coveo.Ui.Facet.prototype.buildIcon. However, overriding this method to return nothing would break the code that calls it (Coveo.Ui.Facet.prototype.buildHeader).

_buildHeader contains a lot more than the call to build the icon markup. Overriding it would have the side effect to also override any fixes that the JSUI team would do in the future in that method.

Ask a question