11Nov
Tag Unions and Tag Intersections in a blog
Posted 3 years ago - 4 comments
I implemented a cool new feature to this site. Now, whenever you are viewing a tag archive page (e.g. “all posts tagged with XYZ”) you’ll see a list of related tags. Next to each of these is a “+” and a “|”.
Clicking the plus sign lets you add tags using the “AND” operator, while clicking the pipe lets you add tags using the “OR” operator.
You can also navigate to specific tag archive pages directly via a crefully constructed URL. For example:
Tag Union - “blogs” and “blogging”
http://trainque.com/index.php?tag=blogs+blogging
Tag Intersection - “blogs” or “blogging”
http://trainque.com/index.php?tag=blogs|blogging
This made possible by Ultimate Tag Warrior for Wordpress.
4 Comments
RSS feed for comments on this post.
I really like the idea of being able to and/or tags. When I read the docs for UTW I could not see that this was actually possible. Is it code you wrote yourself or is it available on the web.
Hi Gary,
it’s totally possible with an out-of-box install of UTW. Here’s what I used:
UTW_ShowRelatedTagsForCurrentTagSet('commalist','<span class="andor"> <a href="%intersectionurl%" >and</a>/<a href="%unionurl%" >or</a></span> %taglink%<br />', $limit=10);Very cool! I am moving UTW to the top of my to-do list!
Just be advised that UTW uses a separate data structure than Wordpress, making it less forward compatible.
More info here: http://m.iscellaneo.us/index.php/2005/08/15/turning-wordpress-into-a-tag-based-blogging-application/