Tagadelic order does not work (outside the BLOCK)

jorre - November 30, 2006 - 13:16

Hey guys, I'm using the following snippet to include tags in my page.tpl.php file (not in a block)

<?php
drupal_set_html_head
('<style type="text/css">@import url('.drupal_get_path('module','tagadelic').'/tagadelic.css);</style>');
$vocs[] = 3; //  id of the vocabulary of which you want to display a tag cloud
$output = theme('tagadelic_weighted',tagadelic_get_weighted_tags($vocs));
print
$output;
?>

is it possible to add some code there to make it respond to SORT order preferences I set in my module. Right now it only sorts by WEIGTH, but I would prefer sorting by title or random...

when I use this code in a block (I don't want to do that), the ordering works...
what's the difference with placing this code snippet just in my page.tpl.php ?

tagadelic_get_weighted_tags($

Bèr Kessels - November 30, 2006 - 14:08

tagadelic_get_weighted_tags($vocs) does the sorting for you. The order is configurable in the interface.

---
Professional | Personal
| Sympal: Development and Hosting

that's my point the sorting

jorre - November 30, 2006 - 14:46

that's my point

the sorting doesn't happen when using the code snippet above directly in page.tpl.php
if I put the code in a block, then the sorting DOES work...

Pakfriet.be
Uzegt.be

Your snippet calls the

Bèr Kessels - November 30, 2006 - 15:29

Your snippet calls the tagadelic_get_weighted_tags function. In that function we do the ordering. So it should be ordered fine, no matter where you use your snippet.

---
Professional | Personal
| Sympal: Development and Hosting

well, as you can see on

jorre - November 30, 2006 - 15:51

well, as you can see on www.uzegt.be the tagadelic cloud isn't really ordered randomly or by title, but always by weigth. I have my tagadelic preferences set to RANDOM though . . .

so my guess is, there is a difference between putting this code in a block (then the sorting DOES work) and putting the code directly in page.tpl.php (there, voc. terms are shown, but not sorted the way they should...)

Pakfriet.be
Uzegt.be

what versions are you

Bèr Kessels - November 30, 2006 - 16:24

what versions are you using?

---
Professional | Personal
| Sympal: Development and Hosting

drupal

jorre - December 1, 2006 - 08:31

drupal 4.7.4

Pakfriet.be
Uzegt.be

No, I mean what version of

Bèr Kessels - December 1, 2006 - 09:42

No, I mean what version of tagadelic :)

---
Professional | Personal
| Sympal: Development and Hosting

Can't seem to find a

jorre - December 1, 2006 - 10:11

ah sorry ;)

Can't seem to find a version in the module files, but in my nl.po file I find this:

tagadelic.module,v 1.19

I downloaded the latest version about one month ago.

but like I said, sorting works in a block, just not outside a block

try pasting the code snippet in your page.tpl.php file, and see if sorting works?

Pakfriet.be
Uzegt.be

Did somebody test it?

jorre - December 1, 2006 - 13:58

Did somebody test it?

pasting the code in page.tpl.php ? (of course, adjusting the voc number)

I really hope to find a way to fix this. tagadelic clouds ROCK when ordered by random!

Pakfriet.be
Uzegt.be

Test with front_page module

TheJohnny - December 11, 2006 - 11:27

I get the same problem with using the code with front_page module (that means outside block - it works fine in a block) :-(

nobody taking a shot

jorre - December 2, 2006 - 18:59

nobody taking a shot here?

Pakfriet.be
Uzegt.be

I'm giving up hopes here...

jorre - December 4, 2006 - 21:23

I'm giving up hopes here... :-)

Pakfriet.be
Uzegt.be

Don't give up

TheJohnny - December 11, 2006 - 12:07

Try this:

$tagcloud = "";
drupal_set_html_head('<style type="text/css">@import url('.drupal_get_path('module','tagadelic').'/tagadelic.css);</style>');
$vocs[] = 2; //  id of the vocabulary of which you want to display a tag cloud
$tagcloud = theme('tagadelic_weighted',tagadelic_sort_tags(tagadelic_get_weighted_tags($vocs)));
print $tagcloud;

It seems you need to use tagadelic_sort_tags function with the code.

RegionalTrend

thanks a bunch! that seems

jorre - December 14, 2006 - 15:23

thanks a bunch! that seems to work!

Pakfriet.be
Uzegt.be

Works really well - thanks.

artatac - March 12, 2007 - 10:57

Works really well - thanks. I would like to use this on my home page ie here is a cloud with ALL terms. But I also have mainsections in my site that I would like to nave clouds relating just to that section eg Education section something like

$vocs = array(1,2,3) + types/education;

is this possible?

I am trying to avoid each dept/section having its own vocabulary as occasionaly it might be relevant for one dept to use another depts term

Regards

Joe

 
 

Drupal is a registered trademark of Dries Buytaert.