Gravatar for ravigupta020287@gmail.com

Question by Ravi, Sep 12, 2018 4:59 AM

Minimum Resources required for omnibox list component?

Hi,

We are using Coveo Omnibox List and Search box views in header of our page, but in order to use omnibox and search box we have to include Search view resources and search box resources which loads large files such as CoveoJsSearch.WithDependencies.min.js

and CoveoJsSearch.Searchbox.min.js.

Do we have to load all the files in our scenario or is there any individual component level js files that we can use which has less size?

Another question i have is, if we have added resources at the top of the page, is it required to add it again in body if we are using coveo search box component in the body again?

In google page speed tool we are getting error about render blocking javascript which has coveo files in it.

Please suggest.

2 Replies
Gravatar for flguillemette@coveo.com

Answer by François Lachance-Guillemette, Sep 12, 2018 11:58 AM

In the Legacy UI (which you are using looking at your included files), you need to include the full `Coveo Search Resources` to have the `Omnibox Result List` component.

In the Coveo for Sitecore Hive UI, you only need to include the `Coveo Search Resources` since the components are Lazy-loaded depending on what you are using on the page.

There is no real solution that we can propose you for the Legacy UI, since Lazy Loading in the Coveo JavaScript Search Framework 2.0 (included in Hive) is the direct response for the problem you are having.

----

> Another question i have is, if we have added resources at the top of the page, is it required to add it again in body if we are using coveo search box component in the body again?

Absolutely not, once the resources are included, you don't need to include it again.

Gravatar for ravigupta020287@gmail.com

Comment by Ravi, Sep 13, 2018 2:59 AM

We are using coveo for sitecore 4.1 (cloud edition), in our case can we use Hive framework for lazy loading, do you have any Hive component usage documentation references?

Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Sep 13, 2018 9:02 AM

You should use only one resources component between:

  • Coveo Search Box Resources (A subset of Coveo Search Resources that can be used on pages where you only have a Coveo Search Box component and nothing else)
  • Coveo Search Resources

When you have an Coveo Omnibox Results List, the full Coveo Search Resources component is required and you can then remove the Coveo Search Box Resources from your page.

The resources have to be included only once on the page, whatever the number of Coveo components you add to that page.

I hope this helps.

Gravatar for ravigupta020287@gmail.com

Comment by Ravi, Sep 13, 2018 10:03 AM

Can we load search box along with omnibox list component and there resources using ajax?

we are trying to load search box view and its resources on button click, NOT on page load, is it possible to do?

we are doing it to avoid the load of CoveoJsSearch.WithDependencies.min.js on page load, since it is large file (1.5 mb) which is slowing down our page.

Ask a question