Related tags with Tags.app and Movable type

Freshness Warning
This blog post is over 16 years old. It's possible that the information you read below isn't current and the links no longer work.

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.

This discussion has been closed.

Recently Written

The Trap of The Sales-Led Product (Dec 10)
It’s not a winning way to build a product company.
The Hidden Cost of Custom Customer Features (Dec 7)
One-off features will cost you more than you think and make your customers unhappy.
Domain expertise in Product Management (Nov 16)
When you're hiring software product managers, hire for product management skills. Looking for domain experts will reduce the pool of people you can hire and might just be worse for your product.
Strategy Means Saying No (Oct 27)
An oft-overlooked aspect of strategy is to define what you are not doing. There are lots of adjacent problems you can attack. Strategy means defining which ones you will ignore.
Understanding vision, strategy, and execution (Oct 24)
Vision is what you're trying to do. Strategy is broad strokes on how you'll get there. Execution is the tasks you complete to complete the strategy.
How to advance your Product Market Fit KPI (Oct 21)
Finding the gaps in your product that will unlock the next round of growth.
Developer Relations as Developer Success (Oct 19)
Outreach, marketing, and developer evangelism are a part of Developer Relations. But the companies that are most successful with developers spend most of their time on something else.
Developer Experience Principle 6: Easy to Maintain (Oct 17)
Keeping your product Easy to Maintain will improve the lives of your team and your customers. It will help keep your docs up to date. Your SDKs and APIs will be released in sync. Your tooling and overall experience will shine.

Older...

What I'm Reading

Contact

Adam Kalsey

+1 916 600 2497

Resume

Public Key

© 1999-2023 Adam Kalsey.