Threadbare no longer (Simplish 2.1.4RC)

Posted by – November 27, 2008

As mentioned in comments onĀ my original mild objection, I’ve been convinced that threaded discussions, new in the upcoming WordPress version 2.7, are a good value at the price. So today I slapped support for the feature into Simplish. This version of the theme should be considered “beta” quality, just like the new WordPress features on which it’s built. Both are subject to change before final release.

Demo
http://labs.utopian.net/who/josh/wp-svn/?p=1
Code
simplish-2.1.4RC.tgz

The demo shows a “jacob’s ladder” style for the comments/replies layout, where both left and right margins are indented per-thread-level. It’s an (experimental) attempt to ease the “comment chaos” feeling a deeply-threaded discussion can give.

A special thanks to Otto for his comments and his indispensable threaded comments getting-started doc.

Notes

For the theme, threaded comments support kicks off in functions.php: a function ocomments() checks if comment threading is available in your WordPress install (i.e., if wp_list_comments() exists; e.g., if it is running on version 2.7 or greater). If not, the theme loads the 2.6-compatible “old” comments template (ocomments.php), and comments look and work with no changes from previous versions. If your WordPress supports threading, the theme loads the new threaded comments template.

From there control of the feature moves to header.php. Simplish loads the comment thread JavaScript only when needed: only if threaded comments are enabled in wp-admin, and then only on single post views. The script is not loaded on multiple- and archive pages where comments are not displayed.

In this execution path, single.php runs next, and that script includes the comments.php comments template. If there are comments on the post, comments.php eventually callsĀ wp_list_comments() to echo the comments loop, producing the threaded result.

The JavaScript enqueued previously by header.php powers the AJAX-ified reply buttons and comment form. (Comment threading will work without this client-side script, but less smoothly.)

Bugs

There may be a few issues with paging threaded comments and reversing order from ascending to descending that can break “pretty” permalinks, as the page number is not always passed into links on comments page one. This issue, if it’s not just ephemera, appears to be a bug in wp_list_comments() and most easily patched there. [Conners 2008-12-12]

Wp_list_comments() produces some hCard classes in its comment loop output, but overall, comment author hCards and comment hAtom are less complete in this testing version than in previous versions of Simplish. To re-add the additional microformat stuff, we’ll filter wp_list_comments(), but this work isn’t started yet.

One place you won’t see threaded comments for a while is here at the Simplish site/blog, nor at the “official” Simplish Demo. Both are hosted on our WordPress-mu-based Labs/Blogs project on the stable version of the multi-blog WordPress software, and MU generally trails wp.org releases and features by a few weeks at least.

Simplish 2.1.4 is planned for final release in conjunction with WordPress version 2.7 — “real soon now.”

Happy [U.S.] Thanksgiving!

2 Comments on Threadbare no longer (Simplish 2.1.4RC)

  1. josh says:

    Another bug I’ve already noticed is that (ping track)^back handling is weak — and rather ugly. A general CSS cleanup and re-sync with changed tags, ids, and classes will happen before release.

    I resist splitting comments from pingbacks as do lots of other themes, because I think ideally the two response forms should be the same kind of communication, merely being sent via two (very slightly) different media.

  2. [...] should be using on your real site, you know, where you don’t run pre-release software like Simplish 2.1.4RC, or WordPress [...]