« prev next »

Adding Tag Support to MovableType

Related Categories
  Blogging
  Friends
  Life
  Me
  Misc
  This Site
  Wendy
  Yifan
  Backstage
  Blog Tips
  Hosting
  Map
  MovableType
  Other Sites
  Spam
  Webcam

Joey asked how I implemented tag in my MovableType. I didn't used plugin. Here is the cookbook to add tag as this blog.

Use Categories in the Tagging Way

First thing is, use the built-in category feature in the tagging way. When you want to assign some tags to an entry, just assign multiple categories. Thanks to the features of MovableType, you can easily add a new category (a new tag). It is not free form, but good enough.

Below is the list of tags I have:

screen-categories-mt.PNG

The list is long.

Adding Tag Chart to Template

One of the key feature distinguishing tags from other category or keyword based classification is, tag chart or tag cloud. Like this:

screen-tag.chart-mt.PNG

In Category Archive template, use the following code:


<!--tagging map-->
<p class=Headlines><MTCategories>
<a style="text-decoration:none" href="<$MTCategoryArchiveLink$>" title="<$MTCategoryCount$>"><$MTCategoryLabel$></a>
</MTCategories></p>

<script language=javascript>
e = document.getElementsByTagName("A");

for(i=0; i < e.length; i++)
{
if(e[i].title != "")
{
t = e[i].title;
if(t > 256) e[i].style.fontSize = "150%";
else if(t > 126) e[i].style.fontSize = "140%";
else if(t > 68) e[i].style.fontSize = "130%";
else if(t > 16) e[i].style.fontSize = "120%";
else if(t > 8) e[i].style.fontSize = "110%";
else if(t >= 2) e[i].style.fontSize = "100%";
else if(t = 1) { e[i].style.fontSize = "80%"; }
}
}
</script>
<!--end of tagging map-->

The codes (including the VBScript) are self-explained.

You can put this piece of code to other pages, like homepage.

Done

It is just as simple as using the existing functions to create a new way of presentation. Anyway, categories, keywords, and tags are not too different in nature.

Happy blogging!


Posted by Jian Shuo Wang at March 8, 2006 7:47 PM
Copyright: You are free to redistribute this work, as long as you keep this disclaimer and this link: http://home.wangjianshuo.com/archives/20060308_adding_tag_support_to_movabletype.htm

Related Entries: MovableType
  1. Subscription Enabled on This Blog April 23, 2008
  2. MovableType Dirify Change for UTF-8 December 23, 2007
  3. MovableType 4.01 and Bluehost CPU Exceeded Error November 16, 2007
  4. Wangjianshuo's Blog Template Archives 2007 November 5, 2007
  5. FeedBurner is a Useful Service August 28, 2007
  6. Upgraded to Movable Type 4 August 18, 2007
  7. MovableType 4 Finally Out August 15, 2007
  8. MovableType 4 is Almost Out August 14, 2007
  9. MTSubCategory of MovableType July 31, 2007
Comments

o,that's a good idea,thank you.
Using the existing functions to create a new way of presentation,hoho,so powerfull of MovableType.

Posted by: Joey (external link) on March 10, 2006 9:04 AM
Post a comment
Name:

Email Address: (will not show)

URL: (optional)

Comments:


It may take up to 30 seconds before the server returns a result. IP address recorded.
Remember my information?

<-- Please click POST only once
© 2001 - 2008 Jian Shuo Wang. All right reserved.