Comment Slicing

Look a new browser, with lots of surprise new features. Seriously surprising. Innovative? Are we talking about Microsoft? Indeed we are. I couldn’t help but have a look to see what interesting new things IE8 might bring, or indeed cock up, around WordPress.
First up, this site works quite nicely in IE8 and so I’m looking forward to changing nothing. Some of my other sites are not so lucky. My new theme for example has a problem or two in the navigation area, but not series ones and so they should be easy to fix.
The new admin theme for 2.5 seems mostly OK, although the visual editor wasn’t working for me and there is a distinct lack of opacity where you would expect it.
I won’t run through all the new features in IE8, I expect you will be sick of hearing about them by this time tomorrow, however, there is one that seemed to have possibilities: Web Slices.
The idea of slices is that web sites can pre-define area of content that are liable to be updated often, using Microformats. IE picks up on this and offers the users the option to subscribe to that section of the page.
IE will check back periodically so If and when that part of the page is updated, the user sees the icon go bold and can open a window containing just that section of webpage. They then have the option of opening the page proper, or deleting the subscription. Easy.
My feeling was that this could be useful for tracking a comment thread. In most cases I think this is likely to be a fairly short term activity that is better suited to this than RSS, although the format does provide the site owner to define an optional alternative tracking technique such as an RSS feed.

To test the idea I have created a slice for the last comment on each post. Anyone using the IE8 beta can subscribe to the last comment on any post, so if a new comment is added the slice will change. When IE next checks it will find it has updated.
The screenshot shows my last comment open while I a reading the BBC website.
So how is it done? Well, it is really easy. It uses a Microformat, an example is below:
<div class="hslice" id="blogtitle-comments-post-<?php echo $post->ID; ?>">
<span class="entry-title" style="display:none;">Comments on <?php the_title(); ?></span>
<div class="entry-content">
<?php comment_text(); ?>
</div>
</div>
The drawback to this is that only the last comment will actually show up. This means that it is possible to miss comments if more than one happens between refreshes.
It will probably be better in the long run to come up with a comment section that simply reports how many comments there have been in the last 15 minutes or something along those lines. At the moment it does not appear as though the preview box has a scrollbar so some messing around with body classes and alternative styles will probably be needed if you wanted to provide your entire comment stream as a single slice.
There is a PDF document for download from Microsoft that explains the methods in more detail. If you going to have a play with this concept you will need it.





