Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Replace default search with Vanoogle

How do you replace the default Vanilla search with the Vanoogle one? Currently the Vanoogle search hovers below my search and obscures the Start New Discussion button.

Comments

  • yes would love to know this too! :)

  • Quick and dirty solution:

    Create a plugin with this

    public $AlreadySent;
    
    public function SearchController_Render_Before($Sender) {
        if (!$this->AlreadySent) {
            $this->AlreadySent = true;
            $Sender->Render($this->GetView('googlesearch.php'));
            die;
        }
    }
    

    and your googlesearch.php

    <?php if (!defined('APPLICATION')) exit(); ?>
    <div class="SearchForm" style="padding-left:3px;">
    <?php
    $Form = $this->Form;
    $Form->InputPrefix = '';
    echo $Form->Open(array('action' => Url('/search'), 'method' => 'get')),
       '<div class="SiteSearch InputAndButton">',
       $Form->TextBox('Search'),
       $Form->Button('Search', array('Name' => '')),
       '</div>',
       $Form->Errors(),
       $Form->Close();
    ?>
    </div>
    <script>
        PUT YOUR GOOGLE SEARCH SCRIPT HERE
    </script>
    <gcse:searchresults-only></gcse:searchresults-only>
    

    Create a CustomSearch and copy over the script you get from there:
    https://www.google.com/cse/all

    Choose the results only view

Sign In or Register to comment.