Changes between Initial Version and Version 1 of TracGoogleSearchPlugin

Sep 4, 2008 10:03:32 PM (6 years ago)



  • TracGoogleSearchPlugin

    v1 v1  
     1= Trac Google Search Plugin = 
     4TracGoogleSearch_ is a trac_ plugin which enables your trac_ environment to 
     5use Google_'s Adsense_ For Search on the mini search box displayed on top. 
     7**Note:** Regular trac_ search won't be disabled, the users must click the 
     8*"Search"* button to access it, and will only show up and work if user has 
     9``SEARCH_VIEW`` permissions, unlike this plugin, which does not 
     10require any special permissions since it's querying Google_ not trac_. 
     14Installing the plugin is as easy as:: 
     16  sudo easy_install TracGoogleSearch 
     18And then enabling it: 
     20.. code-block:: ini 
     22  [components] 
     23* = enabled 
     25And that's it! 
     29In order to use this plugin you must first create a custom search engine on 
     30your Adsense_ account, configure it like you want it and choose to display 
     31the results on a page on your own website. 
     33If you wish Google_ to show results relative to the domain of your trac_ 
     34environment, on your Adsense_ account, edit your search engine settings, choose 
     35*"view more advanced features"*, select *"Search the entire web but emphasize 
     36included sites"* and then under *"Sites"* add your trac_ environment domain. 
     38From the resulting code that Google_ provides we'll need the values from the 
     39hidden fields named, **cx** and **cof**, ie, your client id and search id 
     42Consider the following example code: 
     44.. code-block:: text/html 
     46  <form action="http://domain.tld/gsearch" id="cse-search-box"> 
     47    <div> 
     48      <input type="hidden" name="cx" value="partner-pub-0000000000000000:0aaaa0aaa00a" /> 
     49      <input type="hidden" name="cof" value="FORID:1" /> 
     50      <input type="hidden" name="ie" value="UTF-8" /> 
     51      <input type="text" name="q" size="31" /> 
     52      <input type="submit" name="sa" value="Search" /> 
     53    </div> 
     54  </form> 
     55  <script type="text/javascript" 
     56          src=""></script> 
     59The values you'll need to remember would be 
     60**partner-pub-0000000000000000:0aaaa0aaa00a** and **FORID:1**, the rest of the 
     61code will be provided by the plugin. 
     63The plugin can then be configured on trac_'s administration panel, under the 
     64section **Google** and then **Search**. 
     66Bugs and/or New Features 
     69Please submit bugs of new features to:: 
     74Source Code 
     77If you wish to be on the bleeding edge and get the latest available code: 
     79.. code-block:: sh 
     81  hg clone TracGoogleSearch 
     84**Note**: For up-to-date documentation please visit TracGoogleSearch_'s site. 
     87.. _trac: 
     88.. _TracGoogleSearch: 
     89.. _Google: 
     90.. _Adsense: