Need to use Google Custom Search on didyouknow.org. Stuck the google search code into a chunk and the google search results code in a separate chunk. Placed the search bar chunk at the top of the templates where I want the search bar to be and it looks right. Then created the search results page, with the google search results code chunk in it. But when trying to search, it only goes to the home page (current error page). Does one need a google search plugin or something?
BTW, oddly, when entering a keyword that is same as a page name (eg. "nostradamus") it goes to that page without going to the search results page, although the page being displayed is not the friendly URL one, meaning it doesn’t have the comments and other widgets and chunks on it that it should have.
Google Adsense custom search, I should have specified. As said, stuck the code into chunks but it’s not working, always returning to error page (currently home page) instead of the search results page. Search is one of the most used features on my site. Advice will be massively appreciated.
I can’t get this to work either. If I create a modx page, e.g., SearchResults.html, the page is retrievable when you manually enter that address. However, if Google tries to go to it, it just goes to the home page.
-
☆ A M B ☆
- 2,475 Posts
Remove some variables from our scientific method:
1. What happens when you put the Google code all on one page OUTSIDE of MODx? A normal static page? Does it work?
2. What happens when you put the Google code in one MODx page (no use of Chunks)? Does it work?
Re Google Custom Search via Adsense:
1. Yes, it works in normal html pages - I used it for years on the plain html version of the site.
2. Tried it direct onto template and pages, didn’t work (modx removes some needed div codes). Put it in chunks and it still doesn’t work.
See what happens when you search on didyouknow.org
A solution to this problem would help a lot of modx webmasters because the CPM returns on ads on search results pages typically is higher than ads on other pages.
I’m confused too. The Google search at didyouknow.org seems to be working in IE7 and FF 3.5.2.
Maybe you fixed it?
If only I was half as clever as you guys! ganeshXL, you’re a genius - what an elegant, simple solution! Changed the "q" to uppercase "Q" and the search now works fine. Many thanks.
For the record, yes, I was using the same host and the same Google Custom Search as supplied by Adsense. Re the dropped div tags, I noticed that some codes, especially widget codes supplied by other sites, do get dropped but I guess it is the automated "code cleaning" issue in tinymce (even though I never use the supplied code cleaning button). So, not a modx issue, per se. Of course, sticking the code in a chunk overrides the tinymce issue.
With regards to the mentioned CPM returns, generally the click-through ratio on ads on a search results page is higher than the click-through ratio on ads on normal pages. In these times, every penny counts.
Thanks again for the replies.