Changes between Initial Version and Version 1 of TracGoogleSearchPlugin


Ignore:
Timestamp:
Sep 4, 2008, 8:03:32 PM (16 years ago)
Author:
Pedro Algarvio, aka, s0undt3ch
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracGoogleSearchPlugin

    v1 v1  
     1= Trac Google Search Plugin =
     2{{{
     3#!rst
     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.
     6
     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_.
     11
     12Installation
     13------------
     14Installing the plugin is as easy as::
     15
     16  sudo easy_install TracGoogleSearch
     17
     18And then enabling it:
     19
     20.. code-block:: ini
     21
     22  [components]
     23  tracext.google.search.* = enabled
     24
     25And that's it!
     26
     27Configuration
     28-------------
     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.
     32
     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.
     37
     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
     40strings.
     41
     42Consider the following example code:
     43
     44.. code-block:: text/html
     45
     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="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script>
     57
     58
     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.
     62
     63The plugin can then be configured on trac_'s administration panel, under the
     64section **Google** and then **Search**.
     65
     66Bugs and/or New Features
     67------------------------
     68
     69Please submit bugs of new features to::
     70
     71  http://google.ufsoft.org/
     72
     73
     74Source Code
     75-----------
     76
     77If you wish to be on the bleeding edge and get the latest available code:
     78
     79.. code-block:: sh
     80
     81  hg clone http://google.ufsoft.org/hg/search/ TracGoogleSearch
     82
     83
     84**Note**: For up-to-date documentation please visit TracGoogleSearch_'s site.
     85
     86
     87.. _trac: http://trac.edgewall.org
     88.. _TracGoogleSearch: http://google.ufsoft.org/wiki/TracGoogleSearch
     89.. _Google: http://www.google.com
     90.. _Adsense: https://www.google.com/adsense/
     91}}}