At Cloud Design Box, we have created a free Google search box SPFx web part. It’s a very simple web part to add a Google search box to a modern SharePoint page which then opens up the results in a new tab. Maybe a nice web part for an intranet homepage?
You can download it here or even submit code to the project!
A big thanks to Lloyd for writing most of the code to get this to work and for sharing on GitHub! I’m sure we can develop this over time to make it even more useful.
There are web part properties to change the search results url, you can use your local Google search page. In addition to this you can change the default search text and search button text! Enjoy!
Dear sir,
Do you have a tutorial or explanation how I can implement this towards SharePoint Online?
Greetings & thanks!
Hi Sjoerd,
You can download using the download link on the GitHub page. Unzip it and drop it into your SharePoint online app catalog.
Thanks,
Tony
Thanks, had the wrong file 😛
Hi Tony,
When I upload the webpart to SharePoint Online, Iget the following error
“The package contains the wrong number of relationships for relationship type ‘http://schemas.microsoft.com/sharepoint/2012/app/relationships/package-manifest’. Expected: ‘1’. Actual: ‘0’.”
I get the same error on the classic experience and modern. Any ideas?
Thanks!
Hi Bob,
Hope you are well!
Are you unzipping the download before dragging it into the app catalog? Are you uploading this into the tenant app catalog or a site collection catalog?
Thanks,
Tony
Hi Tony,
I’m well thanks for asking. Hoping the same for you!
Unzipping has done the trick! This is exactly the app we’ve been looking at!
Thanks for your efforts!
Regards,
Is there a way to get the Enter key to submit the search as well?
Yes, the onSearch event in the Search react component should do that:
https://learn.microsoft.com/en-us/javascript/api/react/isearchboxprops?view=office-ui-fabric-react-latest
That is already set in the web part and works for me.
Does this still work? After dragging the folder to the Manage Apps page it uploads ok but then when I open the folder it shows multiple “disabled” with “Invalid SharePoint App package. Error: File contains corrupted data”
What am I doing wrong?
Hi Scott,
Have you unzipped the folder before uploading? It should be the SPPKG file.
Thanks,
Tony
Got it thanks, I was uploading the whole extracted “master” folder thinking those files were necessary for it to work (no experience with these custom apps).
For anyone else having trouble (and for general clarity) extract the “master” .zip you download from GitHub, within it is another .zip file containing the .sppkg file you need extract, and then upload to your SharePoint “Manage Apps” page.
Thanks Tony, and Cloud Design Box, working a treat!
Great, thanks for the tips Scott!