Title

Good Stuff

Ruby on Rails is great with a clean framework, fun language, and an active community.

Why the Lucky Stiff

Ruby on Rails

Ruby

Two things melt my face: fire, and Nine Inch Nails. Their latest album Ghosts is very nice.

Nine Inch Nails

I love this site. Play ’’Bammi’’.

PointlessSites.com

Want to train and don’t know how, or don’t want to pay for an on-line e-coach? Meet Athlo. It’s my latest project. We just rolled out an alpha with tons of development forecasted for the next few months.

Athlo

OmniNerd is like my first child. It the first “real” site I ever wrote. I play a much smaller role these days, but it’s still a great site.

OmniNerd

Adding Talk / Discussion Pages To Trac

I’m a big fan of wikis in general. This week I implemented one to help organize the Athlo project. There are literally dozens of wikis to choose from, but ultimately I went with Trac as it has built in milestone management and is super easy to install on Fedora.

One thing that bothered me was the lack of discussion or talk pages. Luckily, Trac is built on Python and uses the ClearSilver template engine so hacking in this functionality was very easy. Here’s what I did.

In the /usr/share/trac/templates folder, there is a file called wiki.cs. It is the template that defines the wiki (duh). Around line 28, the code looks like:


   <li><a href="<?cs var:trac.href.wiki ?>">Start Page</a></li>
   <li><a href="<?cs var:trac.href.wiki ?>/TitleIndex">Index by Title</a></li>
   <li><a href="<?cs var:trac.href.wiki ?>/RecentChanges">Index by Date</a></li>
   <li class="last"><a href="<?cs var:wiki.last_change_href ?>">Last Change</a></li><?cs
   /if ?>

This defines the links that appear just under the main menus that appear horizontally in the default layout. To add talk pages, I simply modified the code like this:


   <li><a href="<?cs var:trac.href.wiki ?>">Start Page</a></li>
   <li><a href="<?cs var:trac.href.wiki ?>/TitleIndex">Index by Title</a></li>
   <li><a href="<?cs var:trac.href.wiki ?>/RecentChanges">Index by Date</a></li>
   <li><a href="<?cs var:wiki.last_change_href ?>">Last Change</a></li>
   <?cs if:string.find(wiki.page_name, "Talk:") < 0 ?>
   <li class="last"><a href="<?cs var:trac.href.wiki ?>/Talk&#x003A;<?cs var:wiki.page_name ?>">Talk</a></li><?cs
   /if ?>

Note that last part. It simply checks to see if you’re on a Talk page already. If not, if creates a link on the text Talk. If you’re viewing SomeWikiPage, the link will point to Talk:SomeWikiPage. If you’ve ever used wikipedia, it should be very familiar.

What’s nice is this same technique can be used to create any number of meta pages. Happy trac’ing and hacking.