Forum OpenACS Development: Re: Tagcloud

Collapse
2: Re: Tagcloud (response to 1)
Posted by Matthew Burke on
I took a look at this and I whipped some code together (I need to clean it up just a bit).  It works as follows: the input is the ID for a category tree, the proc generates a list of category_id, name and count---how many objects are mapped to that category, it then takes that list and generates an HTML fragment that looks as follows:

<div class="tagcloud">
  <a href="..." style="font-size: 25px;" class="tag">some tag</a>
  <a href="..." style-"font-size: 13px;" class="tag">another tag</a>
...
</div>

where the each link destination is the category page that lists all the objects mapped to that category and the size of the font is calculated by scaling the category's count between a min and max value (this will probably be more clear if I post the code).

So, I think it does what you want.

The big question I am grappling with is how exactly to deal with permissions.  It seems to me that there could be a wide range of different scenarios based on the permissions on the objects, the category trees, the user looking at the cloud, etc.

I'm having a similar conundrum trying to finish up some other code I'm working on---a 'du jour' service that generates an 'X of the day' link.