Related tags with Tags.app and Movable type

Freshness Warning
This article is over 12 years old. It's possible that the information you read below isn't current.

I’m using Tim Appnel’s excellent Tags.app to create my tags pages. For example, see my bestof tag that highlights some of my favorite blog entries.

A new addition to my tag pages is a list of tags that are regularly used with the selected tag. For example, when I use the tag folksonomy I often use the tags tags, tagyu, tagging, simplelinks, web20—those terms are related to folksonomy because I commonly use them together.

To install this feature on your site, you’ll first need to be using the Tags.app plugin. You’ll also need to have Brad Choate’s SQL plugin. And you’ll need to be using MySQL as your database. This might work with other SQL databases, but I haven’t tested it, so you’re on your own there.

Stick this code somewhere in your tag page templates...

Related tags: <MTSQL query="SELECT t1.tagmap_tag, count(t1.tagmap_tag) AS cnt FROM mt_tagmap as t1, mt_tagmap as t2 WHERE t2.tagmap_tag='[MTSearchString]' and t2.tagmap_entry_id=t1.tagmap_entry_id and t1.tagmap_tag != '[MTSearchString]' GROUP BY t1.tagmap_tag ORDER BY cnt desc LIMIT 5"><a href="/tag/<MTSQLColumn column="1">"><MTSQLColumn column="1"></a> </MTSQL>

The entire thing needs to be on a single line in your MT template.

This will take the top 5 tags by usage that are used in entries where the current tag is also used. Want to show more or less tags? Change the LIMIT 5 to LIMIT 10 or whatever number you’d like.

Timothy Appnel
June 8, 2006 11:33 PM

Nicely done Adam. Some form of related tags will be in Tags.App. I released a glimpse in the preview release of the next version of Tags.App I was working on in December. http://code.appnel.com/changelog/2005/12/000019.html That release was put on hold pending the native implemention of tagging in MT.

Your comments:

Text only, no HTML. URLs will automatically be converted to links. Your email address is required, but it will not be displayed on the site.

Name:

Not your company or your SEO link. Comments without a real name will be deleted as spam.

Email: (not displayed)

If you don't feel comfortable giving me your real email address, don't expect me to feel comfortable publishing your comment.

Website (optional):

Follow me on Twitter

Best Of

  • The mouse and me Not only is the mouse very destructive, but it's evaded all attempts to capture or kill it so far.
  • Comment Spam Manifesto Spammers are hereby put on notice. Your comments are not welcome. If the purpose behind your comment is to advertise yourself, your Web site, or a product that you are affiliated with, that comment is spam and will not be tolerated. We will hit you where it hurts by attacking your source of income.
  • The importance of being good Starbucks is pulling CD burning stations from their stores. That says something interesting about their brand.
  • Rounded corners in CSS There lots of ways to create rounded corners with CSS, but they always require lots of complex HTML and CSS. This is simpler.
  • Where do the RSS ad startups fit in? Yahoo's RSS advertising service could spell trouble for pure-play RSS advertising services unless they adapt their business model.
  • More of the best »

Recently Read

Get More

Subscribe | Archives

12

Recently

Stretching your team (Jun 11)
Stretching your team is one of the best ways to improve your output, your team's happiness, and your velocity. But they'll need coaching.
Physical camera shutter for Cisco Spark Board (Jul 6)
A 3d printable design for a camera shutter for a Cisco Spark Board
My Travel Coffee Setup (Jan 20)
What my travel coffee brewing setup looks like, and how you can build your own for under $100.
Turkey Legs (May 30)
Product naming gone awry.
Speaking for Geeks: Your Slides (Dec 17)
Tips and tricks for creating great slides.
Speaking for Geeks: Writing Your Talk (Dec 14)
Don’t wait until the night before the talk to write it. Crazy, I know.
Speaking for Geeks: Tell a Story (Dec 13)
Telling a story keeps your presentation focused, keeps your audience interested, and makes it easier for you to remember your talk.
Speaking for Geeks: Where to speak (Dec 11)
You've got a great idea for a talk. How do you find conferences to submit it to?

Subscribe to this site's feed.

Elsewhere

Tropo
Voice and communications platforms, including Tropo and Phono. Work.
SacStarts
The Sacramento technology startup community.
Pinewood Freak
Pinewood Derby tips and tricks

Contact

Adam Kalsey

Mobile: 916.600.2497

Email: adam AT kalsey.com

AIM or Skype: akalsey

Resume

PGP Key

©1999-2018 Adam Kalsey.
Content management by Movable Type.