Wikidot Themes

BMC WebDesign :: Leading the way in wikidot theme designs.

Fresh from our Blog

The ultimate wikidot comments counter

A sophisticated, conditional way to present the number of comments

A couple of weeks ago Timothy Foster presented the singular/plural CSS changer for counting comments. Today, I’d like to build on his idea and take the comments counting to the next level. The aim is for the comments counter to not only be able to add/remove the 's' on the end of comments, but for it to also say 'No comments yet' when the page has not yet been commented. If you’d like to see it in action, I’ve added it to the comments for BMC blog posts… just scroll down to the bottom of the page.

The basics

We’ll start with the basics, building the singular/plural support. For this tutorial, I'm assuming that you're working with the comments module in the live template, but this could just as easily be applied to the ListPages module.

On the live template (category:_template) with the comments module, you will presumably want to say something along the lines of '12 comments'. To remove that pesky 's' when only one comment has been posted, you just need to wrap a span around the 's', and use the %%comments%% variable in the class name.

%%comments%% comment[[span class="sp%%comments"]]s[[/span]]

Open for Business

open for business sign

We now do requests!

BMC WebDesign is finally here, specialising in custom wikidot themes and site designs.

Attention to detail is our speciality.

If you're ready to give your wikidot site a facelift, we're here to help. We leave no section of your design untouched, so you can be sure you're getting the absolute best, both aesthetically and functionally.

Site design © BMC WebDesign, 2010. All rights reserved. All tutorials on this site are free for personal and commercial use. Disclaimer