Yesterday Sherwin and Geof responded in the comments on the Socialite Life launch entry asking what I thought about WordPress vs. Movable Type. My response would have been too long for a comment so I thought I’d turn it into an entry
LAUNCH: A Socialite’s Life
Our most recently completed weblog happens to be one of the largest Hollywood gossip and entertainment weblogs in the world, A Socialite’s Life. They are “your daily source for celebrity gossip, photos, fashion news, and media speculation brought to you in digestible bites” and it is suggested you enjoy the site while sipping on a martini. I’m a margarita guy myself, but hey, Hollywood news + alcohol is always a win-win 🙂
REBOOT LAUNCH: Hi, Mike
Saying that this site has taken me a long time is like saying that gas prices are a touch too high, it’s a huge understatement. Phark.net was my personal site before but it wasn’t very functional, it just chilled there, never being updated, never looked at, never cared for. I’ve been planning my new personal site since the beginning of last summer (!!!) but haven’t finished it until now. Here it is, the new himike.org:
REBOOT LAUNCH: Business Logs
(If you’re reading this from the comfort of your RSS reader of choice, please take a moment to stop by the actual site and check out the new design.)
The redesign of Business Logs has been a long time coming. The previous design was an iteration from the original, where I flip-flopped the columns and added a nice, big footer to add emphasis to our services.
This new design doesn’t change things drastically, but is rather a design progression. Instead of having a page for our services and a page for our portfolio, they’re now on one big page that I dig a lot. Instead of having confusing weblog archives, they’re now brought together in a new Archives page that hasn’t been uploaded yet, but will be soon. Also, no more puny 9rules logo, nope, I’ve switched to a bright orange badge to show my support.
The About Us page has been updated to finally add Colin to the team, and instead of individual images of us I thought making a collage of some fun times we’ve all had together was more appropriate. I’ve added an Awards & Recognition page to the bottom as well.
Some things aren’t totally together, like the category and main archives are noticeably unfinished right now, but that’ll be changed soon.
The Technical Details
As keen blog surfers will undoubtedly already realize, Business Logs is still running on Movable Type which is my weblog engine of choice. I normally don’t cross into the murky waters of the MT vs. WordPress debate because 9rules members will probably kick my ass, but suffice it to say that I’m more familiar and comfortable with Movable Type so I’ll still be a proud user advocate.
One of the hiccups I encountered with this redesign is that when I logged into my MT install and clicked on “Templates” (something I haven’t done in awhile!) I got an error and couldn’t access any of my templates for editing. After looking into every perl file in my MT install, I finally found on Google a person saying that if you name your templates starting with an underscore (_) character, Movable Type might not let you access them afterwards. I named them with underscores before so certain templates would rise to the top in the list, but now it was screwing me over. Instead of diving into the database and changing them manually, I made a new weblog in my MT install called Springtime and imported all the entries from the Business Logs weblog over there. The nice thing about starting fresh with a “beta” weblog (full of data) is that I can load up individual entry archive pages and mess with them without overwriting the live ones. Movable Type doesn’t let you have staging individual entry archive templates, so this was nice to play with.
I’m messing around with more interesting and useful archive concepts, and one of the fruits of my labor is in the sidebar underneath the 9rules badge. Basically it’s a weblog category browser, sorted by how many entries each category has, and then each category link is enlarged proportionally to how many entries are in that category. Okay, it’s a tag cloud, but it’s a tag cloud done in Movable Type which is not that easy. Well, it’s about to become easy because I’m going to give you the code to make it happen 🙂
Movable Type Tag Cloud
The key to this operation is Brad Chaote’s amazing MTSQL plugin for Movable Type which lets you run custom SQL queries from within a normal Movable Type template tag. If you don’t want to get your hands dirty with PHP, I highly recommend using his plugin.
I installed the plugin, and then got right into my sidebar template with these lines of code:
<MTSQLCategories query="SELECT category_id, COUNT(*) AS number FROM mt_category,mt_placement, mt_entry WHERE (category_blog_id=5) and (placement_entry_id=entry_id) and (entry_status=2) and (placement_category_id=category_id) GROUP BY category_label ORDER BY number DESC"> [do what you want with the categories in here] </MTSQLCategories>
MTSQLCategories is a new template tag that is made possible via your new plugin, and what it does is emulate the normal MTCategories tag, but with a custom SQL query tacked on. This query is kinda complex, but in essence it loads up all the categories from my weblog (happens to be the 5th in my install), then counts all the entries associated with that category (entry_status
of 2 means that they’re published and live), then sorts the category query via how many entries each one has associated with it. Okay, now that we’ve got that out of the way, here’s how you use it.
Inside of the two MTSQLCategories tags you stick the guts of the operation. Basically you are checking to see what the MTCategoryCount of each MTCategory is (aka, how many entries are in that category) and then doing interesting things based on that number. Here’s the code I used:
<li <?php if( <$MTCategoryCount$> < 10 ) { ?>class="low"<?php } else if( <$MTCategoryCount$> < 20 ) { ?>class="medium"<?php } else if( <$MTCategoryCount$> < 30 ) { ?>class="high"<?php } else if( <$MTCategoryCount$> < 100 ) { ?>class="huge"<?php } ?<<>a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$></a></li>
This mash of HTML and PHP outputs one list-item, where the class is determined by how many entries that category has associated with it. Categories that are full of entries are deemed “huge” or “high”, and categories with fewer entries in them are given a class of “medium” or “low”. Now I’ll be the first person to admit that this static number comparison (if( [COUNT] < 10 )...
) is pretty lame and isn’t scalable. What I really wanted to do is get a percentage calculated for each category, so instead of having a hard number comparison, I could say, “for categories that have between 12-15% of the total number of entries in them, give them class X” but sadly I don’t know the MT template tag for “number of total entries” otherwise I would have done it. Can anybody help me out?
And Finally
Got two other sites to finish up for the reboot, so if you’ll excuse me 🙂