Hi Jesus,
at the moment the "tag cloud global" picks up every category name. I have four different sport categories on my page and the global shows them all. To have different names for each global would mean to rename the categories, so I tried to give some information by the title/alt-tag.
Maybe there is a way to show the full_name for each cat in the tag cloud, but that's to much text I think...
That's the global I'm using:
my $category = $DB->table('Category');
$category->select_options('ORDER BY Name');
my $sth = $category->select( ['Has_New_Links','Number_of_Links','Name','Full_Name'] );
my @cats;
while (my $cat = $sth->fetchrow_hashref) {
$cat->{URL} = $category->as_url($cat->{Full_Name}) . "/$CFG->{build_index}";
push @cats, $cat;
}
return { new_categories => \@cats };
}
That's the html in my tag.html
<%loop new_categories%>
<%if Number_of_Links > 200%>
<big><big><b>
<a href="<%URL%>" title="<%Full_Name%>"><%Name%></a>
</big></big></b> -
<%elseif Number_of_Links > 100 eq < 200%>
<b><big>
<a href="<%URL%>" title="<%Full_Name%>"><%Name%></a>
</big></b> -
<%elseif Number_of_Links > 50 eq < 100%>
<b>
<a href="<%URL%>" title="<%Full_Name%>"><%Name%></a>
</b> -
<%elseif Number_of_Links > 25 eq < 50%>
<a href="<%URL%>" title="<%Full_Name%>"><%Name%></a>
-
<%else%>
<small>
<a href="<%URL%>" title="<%Full_Name%>"><%Name%></a>
</small> -
<%endif%>It's far away from perfect but working for me ;-)
Matthias
Matthias
gpaed.de
at the moment the "tag cloud global" picks up every category name. I have four different sport categories on my page and the global shows them all. To have different names for each global would mean to rename the categories, so I tried to give some information by the title/alt-tag.
Maybe there is a way to show the full_name for each cat in the tag cloud, but that's to much text I think...
That's the global I'm using:
Code:
sub { my $category = $DB->table('Category');
$category->select_options('ORDER BY Name');
my $sth = $category->select( ['Has_New_Links','Number_of_Links','Name','Full_Name'] );
my @cats;
while (my $cat = $sth->fetchrow_hashref) {
$cat->{URL} = $category->as_url($cat->{Full_Name}) . "/$CFG->{build_index}";
push @cats, $cat;
}
return { new_categories => \@cats };
}
That's the html in my tag.html
Code:
<%tags%> <%loop new_categories%>
<%if Number_of_Links > 200%>
<big><big><b>
<a href="<%URL%>" title="<%Full_Name%>"><%Name%></a>
</big></big></b> -
<%elseif Number_of_Links > 100 eq < 200%>
<b><big>
<a href="<%URL%>" title="<%Full_Name%>"><%Name%></a>
</big></b> -
<%elseif Number_of_Links > 50 eq < 100%>
<b>
<a href="<%URL%>" title="<%Full_Name%>"><%Name%></a>
</b> -
<%elseif Number_of_Links > 25 eq < 50%>
<a href="<%URL%>" title="<%Full_Name%>"><%Name%></a>
-
<%else%>
<small>
<a href="<%URL%>" title="<%Full_Name%>"><%Name%></a>
</small> -
<%endif%>
Matthias
Matthias
gpaed.de