Saturday April 23, 2005

Site Dynamic

The last couple days I’ve been on a kick to tweak minor code details on my site. I cleaned up a tiny bit of clutter, and also took advantage of plugins and Smarty capabilities. If you want to be potentially bored with the details, I’ve put them in the extended entry.

Though I downloaded it long ago, I never realized how awesome the MT-Compare plugin is! It's a great way to use if/else statements and control output. I've also come to appreciate the MTElse tag, which I somehow overlooked before.

Since most of the plugins available aren't formatted to be used on dynamic templates, one has to resort to either using PHP or taking advantage of the built-in Smarty engine. Chad Everett posted a few weeks ago on how to get the same effects from popular MT plugins by using Smarty. If I ever get especially prolific, I may implement his version of Pagination, but for now I've just used his Smarty equivalent of the Compare plugin.

I used it in my Individual Archives under the Comments. Now the "Comments" header says "Comments" when there are none, "1 Comment" when there is one comment, and "X Comments" when there are multiple, where "X" is the number of comments on that entry. Similarly, if there are no comments, I have posted a little notice that says "No comments yet", just to break up the space and make it obvious that there are no comments.

Using the MTElse tag I have added a condition where if comments have been closed on an entry, there is now some text that says "Comments for this entry are now closed". I'm sure people have been able to figure this out in the past, but it can't hurt to be more clear. Plus displaying conditional information is cool!

I am liking the dynamic pages more and more, especially knowing that with these conditional tags I can mimic behavior that appears on other dynamically generated blogging systems such as Wordpress.

Posted at 2:41 PM | Track comments to this entry vis RSS
1 Comment

Great reading, keep up the great posts.
Peace, JiggaDigga

1 | Posted by: JiggaDigga on April 06, 2006 @ 9:41 PM
Comments for this entry are now closed.

©2002-2008 Jennifer

eXTReMe Tracker