Close

integrating Google Site Search

joster
8 years ago
#9590 Quote
Avatar
  • 130
Hello-

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">
<ul>
<li>
<gcse:searchbox-only resultsUrl="http://www.my.domain.name/search" queryParameterName="p"></gcse:searchbox-only>
</li>
</ul>
</div>


But now, when viewed in a browser, the searchbox is positioned the same in both home and other pages..to 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")
</div>


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.
hristo
8 years ago
#9594 Quote
Avatar
  • Moderator
  • 172
Hi,

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.
Regards,
Hristo Gospodinov
Nop-Templates.com
joster
8 years ago
#9598 Quote
Avatar
  • 130
OK, thanks for the explanation.