Every SocialGO site comes with search for your community sections (members, groups, events etc.) but we've had a few requests asking how you can let your members to search everything, including your custom content pages. Google offer a great free solution with their Custom Search Engine tool. To implement it, simply follow the 3 simple steps below. And scroll even further down for an advanced custom option.
- Sign up at http://www.google.com/cse/: Enter your information, choose from their styling options and copy the code they give you at the end of the process.
- Head to your SocialGO admin panel: Log in to your admin panel, head to the 'Build' section and create a new blank page called 'Search'. Drag a 'Custom HTML' widget into the page, and enter the code you just copied from Google.
- Woohoo! That's it. You'll now have a new page on your site called 'search' that your members can use to search through all of your content.
An advanced alternative: Putting the search box in your sidebar
We've come up with a quick modification that allows you to place the search box in the sidebar of every website page. Thanks to social.rides.com for the inspiration!
- Create a page named 'search' in your site builder as instructed above, but do not copy across the original code they give you. We're going custom!
- While editing the 'search' page in your site builder , click 'Page Settings' and un-tick 'Display in main navigation'. We do not want this page showing as a tab on your website.
- Using a 'Custom HTML' widget, place the following code in the body of the 'search' page you just created. You do not need to edit any of this code.
var googleSearchIframeName = "cse-search-results";
var googleSearchFormName = "cse-search-box";
var googleSearchFrameWidth = 800;
var googleSearchDomain = "www.google.com";
var googleSearchPath = "/cse";
- Next, place the following code in your sidebar using a 'Custom HTML' widget. Please note you'll need to change two values in this code:
<form action="http://[YOURURL]/search" id="cse-search-box">
<input type="hidden" name="cx" value="[PUBLISHERNUMBER]" />
<input type="hidden" name="cof" value="FORID:10" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" size="55" />
<input type="submit" name="sa" value="Search" />
[YOURURL] is your website's URL - for example http://yoursite.socialgo.com or http://www.yoursite.com
[PUBLISHERNUMBER] can be found in the orginal code that you were given by from Google. It's the long number labelled 'var cx' - see the screenshot below:
- That's it! Your new Site Search box will appear in your sidebar - when someone uses it to search, the results will displayed on the 'Search' page!