No doubt, the availability of plugins for Movable Type is few and far between. After searching for a Flash-based tag cloud for Movable Type 4 and finding no results, I finally gave up. Instead, I focused my energy on finding a similar plugin for WordPress and adapting the implementation for use with Movable Type. The result is WP-Cumulus developed by Roy Tanck which is now successfully running in MT.
Being new to MT, I did not know how to create a plugin, so I opted for the implementation instead. For those of you interested in using this excellent plugin on your MT blog, create a dedicated widget and call it say 'Tag Cloud - Flash'. Then in your layout, include this widget. The only file you'll need from the plugin, is the actual swf file. The rest of the files are WordPress specific and you can discard them.
Here's my code for 'Tag Cloud - Flash'
Alternatively, you can download my Tag Cloud Widget here.
A special thank you goes out to Roy Tanck for his work on this project.
Being new to MT, I did not know how to create a plugin, so I opted for the implementation instead. For those of you interested in using this excellent plugin on your MT blog, create a dedicated widget and call it say 'Tag Cloud - Flash'. Then in your layout, include this widget. The only file you'll need from the plugin, is the actual swf file. The rest of the files are WordPress specific and you can discard them.
Here's my code for 'Tag Cloud - Flash'
<div class="widget-tag-cloud widget">
<h3 class="widget-header">Tag Cloud</h3>
<div id="tagcloudflash"></div>
<script type="text/javascript">
var tags = "<tags>";
<mt:Tags limit="30" sort_by="rank">
<mt:If tag="TagRank" eq="1"><mt:SetVar name="font" value="18pt" /></mt:If>
<mt:If tag="TagRank" eq="2"><mt:SetVar name="font" value="16pt" /></mt:If>
<mt:If tag="TagRank" eq="3"><mt:SetVar name="font" value="14pt" /></mt:If>
<mt:If tag="TagRank" eq="4"><mt:SetVar name="font" value="12pt" /></mt:If>
<mt:If tag="TagRank" eq="5"><mt:SetVar name="font" value="10pt" /></mt:If>
<mt:If tag="TagRank" eq="6"><mt:SetVar name="font" value="8pt" /></mt:If>
tags += "%3Ca+href%3D%27<$mt:TagSearchLink$>%27+class%3D%27tag-link-66%27+title%3D%27<$mt:TagName$>%27+rel%3D%27tag%27+style=%27font-size:+<mt:Var name="font"/>%3B%27%3E<$mt:TagName$>%3C%2Fa%3E%0A";
</mt:Tags>
tags = tags.replace(/\?/g, "%3F");
tags = tags.replace(/&/g, "%26");
tags += "</tags>";
var so = new SWFObject("/scripts/tagcloud.swf", "tagcloudflash", "365", "365", "7", "#292929");
so.addVariable("tcolor", "0xEBAF00");
so.addVariable("tagcloud", tags);
so.write("tagcloudflash");
</script>
</div>
Alternatively, you can download my Tag Cloud Widget here.
A special thank you goes out to Roy Tanck for his work on this project.







Hi Steve -
That's really cool. Drop me a line if you'd like help packaging it up into a plugin, because it could be done pretty easily.
Heck, drop me a line if you mind me packaging it up into a plugin, because I think it would be a really nice thing to offer, and it would be easy to put together.
Well done!
What does the 5th parameter ( in this case "7") do?
var so = new SWFObject("/scripts/tagcloud.swf", "tagcloudflash", "365", "365", "7", "#292929");
Dave
The 5th element specifies the version of Flash that is required in order to properly load the SWF. In this case, Flash plugin version 7 is required.
Take a look at the SWF Project page for more details.
Ok, I'm stupid. I'm looking into Movable Type as a family multiblog solution. I have wp-Cumulus enabled on my WP blog and would like to move it over.
Where does the .swf file go on the movable type installation?
Thanks!
Steve, great work! I wish I could make it work now :/ I'm pulling my hair out, could you guys view source on me,
http://www.memeticians.com/roystagcloud.php. I can't figure out what I'm doing wrong for the swf not to display. Thanks!
Sorry guys, the link didn't work out in my above comment so here it is, http://www.memeticians.com/roystagcloud.php
Hank, upon looking at your code, it seems that you have paragraph and newline tags in your Javascript which shouldn't be there.
If you did a copy/paste from my website, this might be the reason why.
Try obtaining the code from here instead.
ok, updated it. still can't get it.
Hank,
It doesn't look like Movable Type is parsing the mt tags. The code needs to go in your MT widgets. Select Design->Widget Sets->Edit Widget Templates. There should already be a widget called Tag Cloud. Create a new one called Tag Cloud Flash for example and enter the code in there. When you publish a new page in MT that has this widget, MT will parse the tags thus making your tag cloud work properly.
if you check out our homepage today, http://www.memeticians.com, you'll see that on the right hand column, i have temporarily added the tag cloud which is now parsing if you check the source, but is not displaying the tagcloud.swf. any ideas?
sheesh, your comments accepts the comma as a part of the link. please disregard the link in my last comment and use this, http://www.memeticians.com
It appears that the version of SWFObject on your site (v2.0) isn't working properly with the script. I'm running v1.5 and your site (from source) with v1.5 works fine and as soon as I change it back to v2.0 it stops working. Perhaps the author has made some changes to SWFObject in the new release. I'm not sure what has changed from the 1.x to the 2.x release. Perhaps contacting the author of SWFObject to see what methods need to be called to properly execute the script, or simply reverting back to v1.5.
Thanks Steve, I have tried a number of different versions of swfobject.js and still no luck. I have left version 1.5 up for you to see...
Hank, The javascript that follows the div id="tagcloudflash" has a problem. The script tag has a src attribute of swfobject.js, followed by inline javascript. The inline javascript is being ignored because the src attribute is specified. Remove the src attribute from this tag because you already have a script tag in the head which calls swfobject. Removing the src attribute from the second script tag should work.
woohoo! steve, you're them man, it's now working! i had originally added the src attribute to the tag because it was not being found and when i hard coded it, the error went away. so it must have been the fact that i was using the wrong swfobject.js version all along.
so now my next problem, lol...
check out our site now, i'm only getting one tag to show in the cloud and the parsing is working fine in the source, except for the fact that it's alphabetizing tags instead of grabbing the top ranked but that's a whole other problem. i'm wondering why the tagcloud.swf isn't accepting the other tags? the other weird thing is that sometimes no tags show at all. thanks for your help again and patience, it's much appreciated.
steve, one thing i noticed about my tagcloud.swf and yours is that i can right click and choose "settings" on yours, but not mine. not sure if this is a permissions thing or variable setting, but our scripts are the same, so i'm confused.
Hank,
Seems like the tag '100%' you have is causing problems with tagcloud.swf. Specifically, it's the percent sign. You can either retag those entries, or add the following (it's a quick workaround that will only fix this one tag)
tags = tags.replace(/%%/g, "%25%");
fantastic! that did the trick, thank you steve. for some reason though, it only works properly on firefox. on IE, tagcloud.swf loads the tags upon first entering the site and does not display them on subpages or even reloading the homepage... weird!
besides the above issue, any ideas why the tag cloud loads alphabetically and not by rank? thanks again.
in addition to my above comment, sub pages load the tags sometimes. i can't find any consistency to why that is.
i fixed the tags listing alphabetically issue. instead of "limit=30", i use "top=10" and now it sorts by rank.
i've fixed all issues now! here is the fix for IE losing the .swf movie on refresh:
var so = new SWFObject("scripts/tagcloud.swf?t=" +new Date().getTime(), "tagcloudflash", "396", "396", "7", "#000000");
steve, how would you recommend varying the font sizes a bit more amongst the top 30 tags for example because right now, they're all the same size. i'm assuming that my top 30 are amongst the same ranked grouping, hence the same saize. i'd also like to change the font and colors or different ranked tags if you have any ideas.