Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I've installed the Drupal 7 version, however, while I have the search box in the header, I would like the ability to display the results in the "Featured" block. Is there a way to do this?
Comments
Comment #1
dsevcik CreditAttribution: dsevcik commentedIs it a matter of taking this piece of code:
from google_cse_results.tpl.php and moving it into our main template in our themes folder?
Comment #2
dsevcik CreditAttribution: dsevcik commentedThis worked!!! For anybody who has this problem, I picked out this section from google_cse_results.tpl.php:
and I dropped it into the section on my main template, node.tpl.php right after the content block starts.
This keeps the search box in the header, keeps the side menus intact, but lets you put the results in whatever block you want. I'm not sure if there is a better/easier way to do this, but this worked fairly quickly.
The only remaining issue, which is small is, I may need to detect in the url if there is a "?cx=", and if so, stop the rest of the content module from displaying in my template so that the rest of it is not pushed down, but rather, not shown.
I'll post here if we try that.
Comment #3
jlea9378 CreditAttribution: jlea9378 commentedThis worked for me on Marinelli theme, all in page.tpl.php:
Comment #4
jlea9378 CreditAttribution: jlea9378 commentedI think this mystery is solved.
Comment #5
jlea9378 CreditAttribution: jlea9378 commentedI was getting a PHP notice related to the $noscript variable being undefined, so I added this and it solved the problem:
if (!isset($noscript)) $noscript = "";
Here's what my code looks like:
I tested it out and it works.
Comment #6
almamun CreditAttribution: almamun commentedHey jlea9378,
Your code worked for me.
Pls accept a huge thanks!
Comment #7
malcomio CreditAttribution: malcomio commented