Navigation Menu
loading content ...
Error Message
Macro 'toolbar' not defined, or not allowed to call [restricted_mode=False]
Rated 4.00/5.00 | Created 02 August 2009
Thanks to some focused effort I have upgraded by blog further so that TiddlyWeb handles commenting rather than instacomments.

It was actually quite simple in the end. I created myself a bag called comments. I gave create permission in the policy to GUEST. I cooked Mike Mahemoff's comments plugin and added the plugin to my TiddlyWiki. This gave me the ability to add comments with a slight adjustment to my myblogViewTemplate so that every blog entry was now commentable.

I then went to another colleague's repository (Ben Gillies) and got his html and tiddlywiki validator plugins to stop people posting nasty things that might break my blog. Essentially these server sides check the content you are posting to a TiddlyWeb bag are free of script tags, systemConfig tiddlywiki tags, don't have reserved names and are free from lions and tigers and bears.

So this gave me basic commenting with hardly any work. The next challenge however was to beefcake comments. Remember I'm trying to fill this TiddlyWeb/TiddlyWiki with as much content as humanly possible while still maintaining a speedy load up time for my visitors. To do this I decided that 1) No comments should be loading at the start. It's just unnecessary. 2) Every time I load a tiddler with commenting I should see all if any comments on that tiddler.

The solution I came up with was to adjust the displayTiddler function call so that everytime one of my blog posts was displayed it would make an ajax call to a comments url as specified in the beefcake config file. Mine is here. As you can see I have prefixed the second line with comments: which tells the beefcake plugin to use this url to load comments. So now everytime someone tries to display something it uses that url to filter the bag for comments relating to the item. Easy. You can check the adjusted beefcake code for this here.

So last but not least, I wanted to have ratings on posts. A similar use case in the project I have been working on in ILGA has popped up so I thought I'd investigate. I also wanted to filter all the stuff I talk about so it's as interesting as possible and I was hoping my users would help me by rating the things I write. So I quickly knocked up a plugin which allows just this. It's nothing WOW - I just setup a url on my TiddlyWeb instance that allows me to call urls like /stats/AVERAGE?value=5&tiddler=foo&field=rating which goes to the tiddler called FOO in a special reserved bag, takes the value passed in the querystring and averages that value with the existing value of the field rating and saves the new value.

I can now query this bag to sort by the field rating to see what interests people most in this big blob of stuff. All the code required to do this can be found in http://svn.tiddlywiki.org/Trunk/contributors/JonRobson/TiddlyWeb/plugins/RatingsPlugin/.

Anyway I've blabbered on too much about stuff that doesn't seem that interesting to me. So go ahead and rate this low to confirm my suspicions..! :)

Thanks for reading this far. Did I bore you or interest you? Let me get better at doing the latter and focus more on working on the good stuff...
Error Message
Macro 'ratemytiddler' not defined, or not allowed to call [restricted_mode=False]
Comments
Error Message
Macro 'tiddlyWebComments' not defined, or not allowed to call [restricted_mode=False]
a list of older blog posts can be found at here

Please ignore the following if you are using a text browser (this is part of the TiddlyWiki application used to run this software):