Related Tag Cloud Plugin

20 views
Skip to first unread message

Will Riley

unread,
Jan 25, 2010, 4:07:27 PM1/25/10
to Omeka Dev
So pcoutas was wondering if we had a related tag cloud:
http://omeka.org/forums/topic/related-tags

The idea is that you want to see the tags in related items, where
items are related if they share at least one tag.

I was thinking that this would be a good plugin and was wondering if
any developers would be interested in making it.

The plugin could have two helper functions, which I've sketched below:

function related_item_tags_as_cloud($order = 'alpha', $tagsAreLinked =
true, $item=null, $limit=null)
{
if (!$item) {
$item = get_current_item();
}
$tags = get_tags(array('record'=>$item), null);
$relatedTags = get_related_tags($tags, $order, $limit)
$urlToLinkTo = ($tagsAreLinked) ? uri('items/browse/tag/') : null;
return tag_cloud($tags, $urlToLinkTo);
}


function get_related_tags($tags = array(), $order = 'alpha',
$limit=null)
{
$db = get_db();
$relatedTags = array();

$tagTable = $db->getTable('Tag');
$taggingsTable = $db->getTable('Taggings');

// you need to fill out the details of the following code

// $relatedTaggings = all the taggings that belong to an item that
has at least one tag in $tags

// get $relatedTags from $relatedTaggings

return $relatedTags;
}

I could figure out the details by myself, but I was wondering if
anyone else in the dev community would like to do that, and thereby
learn more about how to create a plugin.

We could call this plugin RelatedTagCloud

Any takers on this mini development challenge?

Penny

unread,
Jan 28, 2010, 1:02:06 AM1/28/10
to Omeka Dev
I wish there was something I could offer in return for someone working
on this! This plugin would be so useful in my work, and I'm sure it
would be useful for others too! It makes an extra level of analysis
possible. Virtual cookies, anyone?
Reply all
Reply to author
Forward
0 new messages