This module integrates the Custom Search Engines you have already configured through your Google Account with your Drupal website.

You will have to provide you Search Engine's unique ID. To find it, go to your CSE manage page. Click on your already configured Search Engine or Create a New One. Under the Details Section, click the button Search Engine ID.

Ref: https://cse.google.com/cse/manage/all

You can optionally provide the Page Title for the Search Results Page. You can also provide a wildcard URL component that will be used to build you Search Results Page URL. The default value will be google. It is recommended to uninstall other Search modules when you are using this. However this works even with them enabled. Kindly contact the maintainer if you find that it doesn't work.

Once you have installed and configured the module, make sure that you set the permissions to access and administer the settings and results. This modules provides a custom block that should be placed where you want the Search Form to be displayed.

Project Link: https://www.drupal.org/sandbox/immanuelpaul/2724029
Git Clone: git clone --branch 8.x-1.x https://git.drupal.org/sandbox/immanuel.paul/2724029.git gcs

Kindly review the module and post your concerns and suggestions.

Comments

immanuel.paul created an issue. See original summary.

immanuel.paul’s picture

Issue summary: View changes
pravin ajaaz’s picture

Project: Google CSE » Drupal.org security advisory coverage applications
Component: Code » module
pravin ajaaz’s picture

Issue tags: -PAreview: review bonus
immanuel.paul’s picture

Title: [D8] Google Search Engine » [D8] Google CSE
PA robot’s picture

Issue summary: View changes

Fixed the git clone URL in the issue summary for non-maintainer users.

I'm a robot and this is an automated message from Project Applications Scraper.

immanuel.paul’s picture

Status: Active » Needs review
visabhishek’s picture

Status: Needs review » Needs work

Hi immanuel.paul,

Please recheck some points with standards :

1: Do not use tab in gcs.html.twig

{% if title %}
	<h2>{{ title }}</h2>
{% endif %}
<gcse:searchbox></gcse:searchbox>
<gcse:searchresults></gcse:searchresults>
<div id="gcs-results"></div>

2: Follow the Readme template for the README.txt https://www.drupal.org/node/2181737

immanuel.paul’s picture

Hi Abhishek,

I have updated the code as per your suggestions. Thanks for reviewing the project.

Thanks
Immanuel Paul

immanuel.paul’s picture

Status: Needs work » Needs review
immanuel.paul’s picture

Issue tags: +PAreview: review bonus
naveenvalecha’s picture

Status: Needs review » Postponed (maintainer needs more info)
Issue tags: -PAreview: review bonus

@immanuel.paul,
Collaborate with the google_cse module author and push the d8 code into the existing module and apply for the review here.
We always encourage collaboration over competition.

small overview of code :

  • gcs.info.yml : why you set the hidden: false ?
  • gcs.install : gcs_install is not needed if you want to set default values then provide default values in config/install directory . gcs_uninstall is not needed configuration will be automatically removed as the module gets uninstalled.
  • Add a hook_help in .module file.
  • Why restrict access on administer permission in .permissions.yml file.
  • GcsAdminForm : use DI to inject the configfactory service
  • GcsForm : use DI to inject the configfactory service
  • Define the schema/metadata information of the configuration you are using in module https://www.drupal.org/node/1905070
  • GcsBlock : Use DI(Dependency Injection) to inject the Form builder service.
  • GcsController : Use DI(Dependency Injection) here.
  • The search would not work if the Google Custom Search Engine ID would not be set. So add a hook_requirements for it and throw a run time exception on status page. that key is not set.
immanuel.paul’s picture

@Naveen Valecha,

Thanks for your valuable time. Will implement your recommendations and update the thread.

Unlike the google_cse module which integrates with the drupal core search, this module is a much simpler and lightweight version.

However I have updated the google_cse issue queue and provided the git url there.

Ref: https://www.drupal.org/node/2387189#comment-11246483

Thanks
Immanuel Paul

alexmoreno’s picture

any reason of not merging efforts with the current Google CSE module, and the current issue to port it to D8?

https://www.drupal.org/node/2387189

immanuel.paul’s picture

@Alex

I would say this module is a miniature version of the Google CSE and is designed for applications that only needs the basic features of GCS.

I built this module for one of the projects in my organization and thought of giving it to the community for users who may need a lightweight version.

Thanks
Immanuel Paul

alexmoreno’s picture

Hi @immanuel,

thanks for your answer.

I understand, but given that D8 codebase version is just starting, this should be a patch/contribution to the main module, instead of adding duplication creating a module that does the same thing (lighter or not).

In other words, I think this not meet the point 1.2 of the PA checklist: https://www.drupal.org/node/1587704

1.2 Ensure your project is not a duplication.

why not joining forces ;-) ? I don't see any reason why you could not be promoted to contributor and help there, although I'm not sure how to do it outside of the normal project application workflow.

andypost’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)
Related issues: +#2387189: [google_cse] Google Custom Search Engine

That's exactly a duplication (actually 3x) of efforts

avpaderno’s picture