Changes between Version 2 and Version 3 of TracGoogleSearchPlugin
- Timestamp:
- Apr 13, 2018, 10:03:33 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracGoogleSearchPlugin
v2 v3 1 1 [[PageOutline(2-5,Contents,pullout)]] 2 2 3 = Trac Google Search Plugin3 = Trac Google Search 4 4 5 {{{ 6 #!rst 7 TracGoogleSearch_ is a trac_ plugin which enables your trac_ environment to 8 use Google_'s Adsense_ For Search on the mini search box displayed on top. 5 == Description 9 6 10 **Note:** Regular trac_ search won't be disabled, the users must click the 11 *"Search"* button to access it, and will only show up and work if user has 12 ``SEARCH_VIEW`` permissions, unlike this plugin, which does not 13 require any special permissions since it's querying Google_ not trac_. 7 This plugin enables your Trac environment to use Google's Adsense for Search on the mini search box displayed on top. 14 8 15 Installation 16 ------------ 17 Installing the plugin is as easy as:: 9 **Note:** Regular Trac search won't be disabled, the users must click the Search button to access it, and will only show up and work if user has `SEARCH_VIEW` permissions, unlike this plugin, which does not require any special permissions since it's querying Google not Trac. 18 10 19 sudo easy_install TracGoogleSearch 11 == Bugs/Feature Requests 20 12 21 And then enabling it: 13 Existing bugs and feature requests for TracGoogleSearchPlugin are 14 [report:9?COMPONENT=TracGoogleSearchPlugin here]. 22 15 23 .. code-block:: ini 16 If you have any issues, create a 17 [/newticket?component=TracGoogleSearchPlugin new ticket]. 24 18 25 [components] 26 tracext.google.search.* = enabled 19 [[TicketQuery(component=TracGoogleSearchPlugin&group=type,format=progress)]] 27 20 28 And that's it! 21 == Download 29 22 30 Configuration 31 ------------- 32 In order to use this plugin you must first create a custom search engine on 33 your Adsense_ account, configure it like you want it and choose to display 34 the results on a page on your own website. 23 This plugin is available on [pypi:TracGoogleSearch PyPi]. 35 24 36 If you wish Google_ to show results relative to the domain of your trac_ 37 environment, on your Adsense_ account, edit your search engine settings, choose 38 *"view more advanced features"*, select *"Search the entire web but emphasize 39 included sites"* and then under *"Sites"* add your trac_ environment domain. 25 == Source 40 26 41 From the resulting code that Google_ provides we'll need the values from the 42 hidden fields named, **cx** and **cof**, ie, your client id and search id 43 strings. 27 Check out TracGoogleSearchPlugin from [pypi:TracGoogleSearch PyPi]. 28 29 == Installation 30 31 General instructions on installing Trac plugins can be found on the [TracPlugins#InstallingaTracplugin TracPlugins] page. 32 33 == Configuration 34 35 In order to use this plugin you must first create a custom search engine on your Adsense_ account, configure it like you want it and choose to display the results on a page on your own website. 36 37 If you wish Google_ to show results relative to the domain of your trac_ environment, on your Adsense_ account, edit your search engine settings, choose *"view more advanced features"*, select *"Search the entire web but emphasise included sites"* and then under *"Sites"* add your trac_ environment domain. 38 39 From the resulting code that Google_ provides we'll need the values from the hidden fields named, **cx** and **cof**, ie, your client id and search id strings. 44 40 45 41 Consider the following example code: 46 42 47 .. code-block:: text/html 48 43 {{{ 49 44 <form action="http://domain.tld/gsearch" id="cse-search-box"> 50 45 <div> … … 56 51 </div> 57 52 </form> 58 <script type="text/javascript" 59 src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script> 60 61 62 The values you'll need to remember would be 63 **partner-pub-0000000000000000:0aaaa0aaa00a** and **FORID:1**, the rest of the 64 code will be provided by the plugin. 65 66 The plugin can then be configured on trac_'s administration panel, under the 67 section **Google** and then **Search**. 68 69 Bugs and/or New Features 70 ------------------------ 71 72 Please submit bugs of new features to:: 73 74 http://google.ufsoft.org/ 75 76 77 Source Code 78 ----------- 79 80 If you wish to be on the bleeding edge and get the latest available code: 81 82 .. code-block:: sh 83 84 hg clone http://google.ufsoft.org/hg/search/ TracGoogleSearch 85 86 87 **Note**: For up-to-date documentation please visit TracGoogleSearch_'s site. 88 89 90 .. _trac: http://trac.edgewall.org 91 .. _TracGoogleSearch: http://google.ufsoft.org/wiki/TracGoogleSearch 92 .. _Google: http://www.google.com 93 .. _Adsense: https://www.google.com/adsense/ 53 <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script> 94 54 }}} 95 55 96 This plugin is also available on [pypi:TracGoogleSearch PyPi]. 56 The values you'll need to remember would be **partner-pub-0000000000000000:0aaaa0aaa00a** and **FORID:1**, the rest of the code will be provided by the plugin. 57 58 The plugin can then be configured on trac_'s administration panel, under the section **Google** and then **Search**. 59 60 == Recent Changes 61 62 See [pypi:TracGoogleSearch PyPi]. 63 64 == Author/Contributors 65 66 '''Author:''' Pedro Algarvio [[BR]] 67 '''Maintainer:''' [[BR]] 68 '''Contributors:'''