[Tutorial] How to Make Separate Search Page With Google Custom Search
I have recently set up a separate search page in my forum because -
#. Vanilla search is unreliable and results have no relevance to search query.
#. Google search is well known; user will love it.
#. You can even earn by Google search.
I am sharing the steps for everyone's benefit -
Step 1: Download and enable Extra Page plugin. (Thanks Peregrine)
Step 2: Go to routes, make a copy the extra page route with whatever name you prefer. Mine is Route Expression -
^search-discussions(/.*)?$ and Target -
plugin/ExtraPage$1 with Type -
search because it's a registered keyword and we want to be safe.
Step 3 Edit default.php in your ExtraPage plugin if you don't want link in your menu bar. Comment out/delete line 15 to 20 i.e the very first function Base_Render_Before. Do this only if you do not want extra link in your menu bar.
If you have edited default.php and disabled making new link, remember that you will have to add it manually. I would recommend adding a search link at right side of menu bar which is standard practice.
Step 4 Head to Google CSE and choose full width layout and get your code.
Step 5 Edit extrapage.php in plugin folder and paste the code.
You are done. 5 minutes of work and you users will thank you. Check mine here.
[Click Awesome if you liked this]
There was an error rendering this rich post.