MeasureMap and Typo
Posted by kev Wed, 09 Nov 2005 01:41:00 GMT
So, if you’re one of the lucky few who have gotten into the MeasureMap private alpha here’s how you can easily add support into typo. MeasureMap is really way cool. I’ve only had it a few hours, so I’ll be posting some impressions as soon as I have gathered my thoughts.
Step 1: Visitors snippet
To track hits to your site, you need to add the tracking snippet to your theme’s default layout. This can be found in TYPOROOT/themes/YOURTHEME/layouts/default.rhtml.
Look in that file, and add the tracking snippet provided in the Help -> Other -> Footer Template section on MeasureMap just before the </body> tag.
Note: The links you need to add are user dependant, so I don’t paste them here.
Step 2: Comments snippet
Next, add the following snippet to your TYPOROOT/app/views/articles/_comment.rhtml at the bottom of the file.
<script type="text/javascript"><!--
if(!mmcomments){var mmcomments=[];}mmcomments[mmcomments.length]="<%= comment.id %>";
//--></script>
<!-- mmc mmid:<%= comment.id %> mmdate:<%= comment.created_at %> mmauthor:<%= h(comment.author) %> -->Step 3: Articles snippet
Finally, add this block to the TYPOROOT/app/views/articles/read.rhtml file.
<script type="text/javascript"><!--
if(!mmposts){var mmposts=[];}mmposts[mmposts.length]="<%= @article.id %>";
//--></script>
<!-- mmp mmid:<%= @article.id %> mmdate:<%= @article.created_at %> mmurl:<%= h(a
rticle_url(@article)) %> mmtitle:<%= @article.title %> -->

MeasureMap – there’s something I gotta test drive. I remember speaking to a guy who worked on this – sounded pretty cool.
Test
Thanks for the useful pointers. Apparently they are also working on a plugin (sidebar?) for Typo that will automate this.