Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
941 views
in Q2A Core by
I want to add google search box and want to show result within the site. But google doesnt allow to reduce result page width less than some 750px. So search result is spreading over side bar too. So i want to hide side bar when moving to search result.

Please help me on this..
Thanks... :)

1 Answer

+1 vote
by
 
Best answer
Use an advanced HTML theme to override the sidepanel() function. Your replacement function should look something like this:

function sidepanel()
{
    if ($this->template!='search')
        qa_html_theme_base::sidepanel();
}

This function calls the default sidepanel() function only if it's not a search result page, otherwise it does nothing.
by
Thanks Gidgreen, I will implement and update you!
by
Hi Gidgreen, I have added new page called 'gsearch' (to show Google search result) and I added the code given by you just by changing 'search' -> 'gsearch'.
But in side panel customised contents (adv & email subscription form) added in side bar box (not side panel) thru admin page are displayed in gsearch page. How to hide those?

Could you please help me on this?

Could you please help me on this?
by
Your custom page won't set $this->template so try checking on $this->request instead. You can also use PHP's echo function to output the value of these variables as a temporary measure to see what they are in different situations.
by
Perfect!
Works perfectly!

Thanks again Gidgreen! :)
...