01/12/03

Comments 6

Flip Flop

A few folks have asked me how I created the alternating background colours in the comments sections. I use a Movable Type plug-in called ‘Flip Flop’, written by a chap called Gavin Estey. I’d been wanting to use this for a while, and finally got around to implementing it.

All you need to do is create the 2 alternating styles (an odd and an even) in your css, and then put the following code into your MT template. In this simplified example, I’ve used ‘green’ and ‘white’ as my 2 options.

CSS:

/* MT Flip Flop styles */
.green {
padding: 8px;
background: #EEF7DD;
}
.white {
padding: 8px;
background: #fff;
}

Movable Type:


<MTComments>
<div class="<$MTFlipFlop odd="green" even="white"$>">
<$MTCommentBody$>
</div>
</MTComments>

The Flip Flop plug-in then decides which style it needs to use. Thanks Gavin!

Technorati TagsTags: , ,

Comments | RSS

Comments are now closed, but you can still have a jolly time reading what others have left:

#1

ste said 1863 days ago:

Wow, nifty - and to think I went to all the trouble to write a little PHP snippet to manage that in an older version of the site. I should look into that, though - thanks for sharing! :D
#2

Jon Hicks said 1863 days ago:

Ah yes, but the feeling of acheivement, having written a script yourself! Its far more satisfying!
#3

Matthew Walburn said 1863 days ago:

Excellent! This is just the thing I've been looking for to spice up my blog a little. (not that that process ever stops!)

-Matthew
#4

Jon Hicks said 1863 days ago:

I know what you mean - I'll be fiddlin' an' tweakin' till the day I die...
#5

Lars said 1863 days ago:

Ah yes, but the feeling of acheivement, having written a script yourself! Its far more satisfying!



Well, I'm on WordPress. Can't wait for that script; can you have it ready by Monday? :)

#6

The Scholar said 1862 days ago:

Thanks for the information. Flip-flop definitely seems like a handy tool. Will have to check it out some time.

love

Brit Pack: A proud member I love Omniweb Coda Segment Publishing I buy my type from Veer The Forgiveness Project