integrating Google Site Search

4 years ago
#9590 Quote
  • 127

We are integrating Google Site Search (Custom Search Engine) into our nopCommerce 3.40 site with the Alfresco theme.

I have it working now on our development site, but I need help understanding how the search box is displayed in two different positions on the Alfresco theme.

What I mean is, on the home page, the searchbox is aligned to the left, whereas it is aligned to the right and positioned lower in the header of all other pages.

To integrate GSS, it was necessary to replace all code on the /Views/Catalog/SearchBox.cshtml with only this code:

<div class="search-box">
<gcse:searchbox-only resultsUrl="" queryParameterName="p"></gcse:searchbox-only>

But now, when viewed in a browser, the searchbox is positioned the same in both home and other the right?????

So..I want to create a new class in my styles to position the searchbox differently on the home page.

I see this code at the bottom of \Themes\Alfresco\Views\Shared\_Header.cshtml:

<div class="search-box">
@Html.Action("SearchBox", "Catalog")

I understand it is where searchbox is called for header of all pages.
But, I DO NOT understand from where is it called to appear on the home page so that I can specify a different class for it's div.

Please help.
4 years ago
#9594 Quote
  • Moderator
  • 123

there is no separate search box for the home page, it is only one search box that renders throughout the whole website, the different positioning on the home page  is because of CSS styling.

You can style the search box on your home page in two ways. The first is to do it by using the .main-slider-header class name for inheritance, this class is present only if you have a homepage slider enabled and is present only on the home page.

The other way is to do it by using .master-home-page class name for inheritance, in case you don't have a homepage slider.

But if you don't use a slider, the search-box will render to the right by default anyway. Let us know if you need more assistance.
Hristo Gospodinov
4 years ago
#9598 Quote
  • 127
OK, thanks for the explanation.