Home About Me

Adding a Poll, and a Case for Decoupling Typecho's Sidebar

I finally got around to adding a poll to the site, following the plan I'd laid out. It now sits in the sidebar — though under certain media queries it drops to the bottom of the page instead of staying off to the side.

Coding it took very little time. I embedded a third-party survey tool, Wufoo, which is essentially an iframe dropped into the page. I'll swap the poll question out periodically. Some of them will be aimed at helping me understand readers better so I can tune the site to serve them; I'll quietly make changes based on what comes back. When the statistics are something I can share publicly, I'll post the results and analysis here as well.

The first poll is admittedly a rather shallow one:

Do you think the current Jiongks theme looks good?

While wiring up the poll, I ran into a gap in Typecho: creating a new sidebar panel inevitably means editing the theme's sidebar.php. Typecho doesn't provide a plugin hook for the sidebar, so there's no way to generate a custom panel from a plugin. A reasonable fix might look like this:

  1. Add a new configuration option where you declare which sidebar panels should appear and in what order.
  2. Standardize the panel's HTML structure — no custom markup allowed, only custom content inside it.
  3. Expose an interface on the plugin side for registering custom panels.

That would push the theme template and the plugin further apart, letting developers adjust what shows in the sidebar without touching the theme at all.

Just a personal observation — I don't know whether Typecho would be interested in taking it up.