« show who's linking to you | Main | dynamically-generated individual archive pages »

using key values to store additional information

The Key Values plugin offers one way to store more information with each entry than you have fields for.

I use it on The Clipboard to create the "Other Views" section. There are several services such as Blogdex, Waypath, and Technorati that will list what blogs are linking to a particular webpage.

On The Clipboard I post news articles about current events. Quite often, other bloggers might also be posting about these articles. So the Other Views section links to the lists created by Blogdex, Waypath, and Technorati. Visitors can easily check out what other bloggers are saying about these articles. In order to create these links specific to each entry and the article I've linked to, I need to pass the article's URL to Blogdex, Waypath, and Technorati.

I do this using the Key Values plugin. At the bottom of the extended entry field for each entry I type:

reference=http://www.url.com

and put the URL for the article there. The Key Values plugin then grabs this data and stores it, to be called by other Key Values tags. The code looks like:

<MTKeyValues>
<MTIfKeyExists key="reference">
<a href="http://blogdex.media.mit.edu/metalinker/sources.asp?url=<$MTKeyValue key="reference"$>">Blogdex resources on <$MTKeyValue key="reference"$></a><br>
<a href="http://nav4.waypath.com/rwn.jsp?url=<$MTKeyValue key="reference"$>">Waypath resources on <$MTKeyValue key="reference"$></a><br>
<a href="http://www.technorati.com/cosmos/links.html?rank=&url=<$MTKeyValue key="reference"$>">Technorati resources on <$MTKeyValue key="reference"$></a>
</MTIfKeyExists>
<MTIfNoKeyExists key="reference">
(none)
</MTIfNoKeyExists>
</MTKeyValues>

Finally, I wrap the whole section using the MTIfCategory tags from the Supplemental Category Tags plugin so that it only shows up for Clipboard entries.

About This Blog

  • Disclaimer: This is a personal site and is not connected with Six Apart, Ltd, the makers of Movable Type
  • Contact me:
  • Readme: What this blog is and is not
  • Reference: Templates for Al-Muhajabah's Islamic Blogs

August 2008

Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

Tips by Type

Tips by Area

Other ways to read this blog

Feed Subscribe to this blog's feed
(default is RSS 2.0, I also have RSS 1.0 and Atom)

Text-only version
Powered by
Movable Type 3.2