« spread your content over multiple pages | Main | have an icon for each category »

display images conditionally

On my category archive pages, you'll notice that some posts have little icons next to them. These icons indicate whether the blog entry has been commented on, if it has more than 10 comments, if anybody has pinged it with trackback, and if I pinged another blog while posting that entry.

This is all done using the Compare plugin. The Compare plugin allows you to use MT to compare the values of two things and print something if the comparison is true. In this case, I'm checking to see if the values of <$MTEntryCommentCount$>, <$MTEntryTrackbackCount$>, and <MTPingedURLCount$> (a tag from the PingedURLs plugin) are greater than zero and, if so, displaying code for an image. I'm also checking MTEntryCommentCount to see if it's greater than 10 to display a different image.

This is but one of many uses for the Compare plugin, some of which I'll discuss later. It adds a great deal of flexibility to your blog.

About This Blog

  • Disclaimer: This is a personal site and is not connected with Six Apart, Ltd, the makers of Movable Type
  • Contact me:
  • Readme: What this blog is and is not
  • Reference: Templates for Al-Muhajabah's Islamic Blogs

August 2008

Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

Tips by Type

Tips by Area

Other ways to read this blog

Feed Subscribe to this blog's feed
(default is RSS 2.0, I also have RSS 1.0 and Atom)

Text-only version
Powered by
Movable Type 3.2