|
How do I display Google results in my site? |
|
Display Google web search results in your Joomla! site's content becomes in a professional apearance and your visitors get access to the popular Google searches directly within your site. Many times we look for a component for tasks like this, but it can be done with Joomla! core's features.
The Google code:
-
If you don't already have an Google AdSense account,
. Once you confirm your e-mail, it could take several days for the Google people review your application.
-
Once you get your AdSense account, login and select the "AdSense Setup" tab. From the option shown there, select "Adsense for Search".
images/stories/Joomla/core/google_adsense_product_select.gif{/slimbox}
-
You will see a several options to configure your search box and search results page. You will see a section named "More options" where you will set this options:
images/stories/Joomla/core/google_adsense_search_setup.gif{/slimbox}
- Site language: set as required.
- Opening of search results page: selelect "Open results within my own site"
- Enter the URL where search will be displayed: http://www.your-joomla-site.com/index.php
- Enter width of results area: set as required.
- Your site encoding: set as required.
-
When finished scroll down the screen and at the bottom you will see two codes: "Your search box code" and "Your search results code". We will refeer this later.
In your Joomla! backend:
- Disable the WYSIWYG editor
- Select "Site > Global Configuration" from the main menu
- In the "Site" tab set the Default WYSIWYG Editor to "No WYSIWYG Editor"
- Click the Save icon
- Create a new Static Content with "Your search results code" as content
- From the main menu select "Content > Static Content Manager"
- Clck over the New icon
- Paste "Your search results code" in the Text(required) area
- Fill the title with somethins like "Google powered Search Results"
- Leave the default Access Level: Public
- Be sure to check the Publish option
-
Leave the other parameters with theirs default values or if you're an experienced user modify them as required
- Click the Save icon
-
In the static content list look for the ID of the just created content and write it somewhere
-
Create a new option in a hidden menu linking the static content created in the previous step. Usually othermenu is useless and it can be hidden unpublishing its module (don't unpublish the menu) the idea is prevent the users click this option and get an empty page but get an Itemid to control which modules are shown there.
- Select "Menu > othermenu" from main menu.
- Click over the "New" icon
- Select "Link - Static Content" and click over the "Next" icon.
- Write a "Name" like Search results
- Select the "Static Cotent" created in the previous step
- Leave all other parameters as default
- Click the "Save" icon
- Look for the Itemid of the menu option just created and write it somewhere
- Select "Modules > Site Modules"
- Locate the "Other Menu" module and unpublish it
- Create a new module to show the Google search box inserting "Your search box code" as module content
- Test your search module in the front-end and adjust the static content or module as required
- Enable the WYSIWYG editor
Every time you edit the static content and module created here you MUST disable the WYSIWYG editor.
|
0 Comments