[ic] sorted (translated) categories - better ideas?
Gert van der Spoel
ic at 3edge.com
Sun Sep 11 18:42:39 EDT 2005
Hi,
Here some lines I wrote to show categories on the page in alphabetical
order, also when they have been translated. It works fine, so no problems
there. Just curious if anybody has any better/shorter/more efficient ideas
to get the same result.
CU,
Gert
[seti catlist][/seti]
[query sql="select category from products group by category" type=list]
[list]
[seti catlist][msg][sql-param category][/msg]==[sql-param
category],[scratch catlist][/seti]
[/list]
[/query]
[calcn]
my @list = split(/\,/,$Scratch->{catlist});
my ($trans,$orig,$output);
foreach my $tmpit (sort @list) {
($trans,$orig) = split(/\=\=/,$tmpit);
$output .= '> [page search="se='. $orig .' sf=category"]'
. $trans . '[/page]<br>';
}
return $output;
[/calcn]
More information about the interchange-users
mailing list