| 66 | == Adding Google Ads to your Trac == |
| 67 | It actually pretty simple now that I know it, here it goes. |
| 68 | On your trac environment directory, edit '''`site_css.cs`''' and put this inside: |
| 69 | {{{ |
| 70 | #!css |
| 71 | #content { |
| 72 | padding: 0; |
| 73 | margin: 15px 140px 0 15px; |
| 74 | text-align: left; |
| 75 | min-height: 770px; |
| 76 | } |
| 77 | |
| 78 | #ads { |
| 79 | position: absolute; |
| 80 | top: 170px; |
| 81 | right: 10px; |
| 82 | width: 140px; |
| 83 | z-index: 1; |
| 84 | text-align: right; |
| 85 | } |
| 86 | }}} |
| 87 | Now a bit of explanation. Settings are of course, of topic, if you have doubts, there's a CSS link above in this page, click it, even so I'll explain parts. First we override '''`#content`''', trac's main content div id so we can have space for our ads. The most important part is that '''`140px`''', our right margin, we also set a minimun height or else the ads would be on top of the footer in case the wiki page is small enough. |
| 88 | |
| 89 | Now we'll need to add the Google Ads code somewhere right? Edit '''`site_footer.cs`''', and next is an example: |
| 90 | {{{ |
| 91 | #!text/html |
| 92 | <div id="ads"> |
| 93 | <!--- Start of Google Ad Code --> |
| 94 | YOU WOULD PASTE IT HERE |
| 95 | <!--- End of Google Ad Code --> |
| 96 | </div> |
| 97 | }}} |
| 98 | |