113 | | As a follow up on the previous subject |
| 113 | As a follow up on the [http://projects.edgewall.com/trac/wiki/TracInterfaceCustomization#GoogleAdsenseForContentAds previous subject], I'll introduce one more way to add income to your Trac env, replacing trac's search box seen on the top right of trac's header for one that Google Adsense provides. First generate the code you need by logging into [http://google.com/adsense Google Adsense] and selecting "Google Adsense for Search", there you find enough info on how to generate it. |
| 114 | |
| 115 | Now we'll need to add an additional DIV to '''`site_css.cs`''', here it goes: |
| 116 | {{{ |
| 117 | #!css |
| 118 | #GoogleSearch { |
| 119 | position: absolute; |
| 120 | top: 3px; |
| 121 | right: 3px; |
| 122 | z-index: 1; |
| 123 | } |
| 124 | }}} |
| 125 | |
| 126 | Now you'll need to add the previous generated search box HTML code somewhere. Edit '''`site_header.cs`''' to look something like: |
| 127 | {{{ |
| 128 | #!text/html |
| 129 | <div id="GoogleSearch" |
| 130 | <!--- Start of Google Search Box Code --> |
| 131 | YOU WOULD PASTE IT HERE |
| 132 | <!--- End of Google Search Box Code --> |
| 133 | </div> |
| 134 | }}} |
| 135 | What happens is that the '''`#GoogleSearch`''' DIV is placed on top of Trac's search box, and by this, replacing it. Do NOTE that Trac's search will still be available, you'll just need to click the search button on the navbar. |
| 136 | |
| 137 | '''IMPORTANT: Do read Google's [https://www.google.com/adsense/localized-terms Terms & Conditions], your account will be forzen/deleted and you won't get any amount you had previouly earned if you don't FOLLOW THEM''' |
| 138 | |