Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google search in sticky nav #735

Closed
wants to merge 3 commits into from
Closed

Conversation

benlk
Copy link
Collaborator

@benlk benlk commented Jun 3, 2015

Changes

  • Adds Google Custom Search to the sticky nav search if it's enabled, and styles
  • CSS fix for "When you're on the search results page, the top bar breaks and gets a lot bigger." in less/inc/search.less

Search results display in the same popup that they do if you use the search in the global nav. Here's how it looks on mobile:

mobile

And the sticky nav item keeps the "Powered by Google" bit:

screen shot 2015-06-02 at 7 13 00 pm

Why

Requested for YT-35, Largo ticket #730.

Debt

This assumes that the form-containing div created by Google's scripts has the id ___gcse_1. If that changes, the styles will break and the nav will look hideous. We should notice fairly quickly if Google changes that..

@rnagle
Copy link

rnagle commented Jun 3, 2015

Is there an option to use a separate results page instead? Showing results in the dropdown seems a little weird to me and might not be right for everyone.

The actual search form looks strange to me. The spacing between the text field and submit button could be less. The spacing around the "powered by Google" could be more. Also note the blue button is skewed.

@benlk
Copy link
Collaborator Author

benlk commented Jun 4, 2015

Pushed some changes. I'm not entirely sure what Google is trying to do with the blue button, but it now displays in Chrome, Firefox and Safari like so:

screen shot 2015-06-03 at 10 58 38 pm

The "Powered by Google" disappeared, because of a Google CSS rule. ¯_(ツ)_/¯

The modal search results dialog is injected by Google's search form in response to the search. The TOS for the custom search require that we not modify the search results or their display in any way, so I don't think we should try to get them to display natively within WordPress. See section 1.4.

@benlk
Copy link
Collaborator Author

benlk commented Jun 23, 2015

Closing in favor of #756

@benlk benlk closed this Jun 23, 2015
@rnagle rnagle deleted the YT-35-ben-sticky-nav-google-search branch July 13, 2015 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants