I have a tagcloud in my page template (so I get the cloud on every page) but I want to limit the amount of tags in that cloud. In my tagadelic settings I set the number of tags to 5 per cloud and the php snippet I use in the template is

$tagcloud = "";
drupal_set_html_head('

@import url('.drupal_get_path('module','tagadelic').'/tagadelic.css);

');
$vocs[]= 4; // ids of vocabs for which you want to build a tag cloud
$tagcloud = theme('tagadelic_weighted',tagadelic_sort_tags(tagadelic_get_weighted_tags($vocs)));
print $tagcloud;

Still all the tags in the vocabulary show up in my cloud...

site is reloadingimages.wsnw.net/drupal/

Thanks,

wouter

Comments

ckreutz’s picture

Priority: Critical » Minor
Status: Active » Fixed

The limitation on the site configuration is only meant to be for the tag overview: e.g. tagadelic/list/1

If you want to limit your tags in a block just add the following figures next to $vocs separated by commas:

$tagcloud = theme('tagadelic_weighted',tagadelic_sort_tags(tagadelic_get_weighted_tags($vocs,6,20)));

The 6 stands for the level and 20 would show 20 tags.

I guess that is solved. :-)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.