I am interested in providing a list of categories in which the link is present in the database. Currently I have a list of categories, to which the link is located, generated and displayed. You can see can example of this here:
http://www.policy.ca/...ry/Detailed/833.html
look down and at the "Subjects / Category:" field in the table. I like the way this works, but I would like to refine the result so that it presents that output like this,
Policy Articles / Aboriginal
Policy Articles / Aboriginal / Governance
Policy Articles / Aboriginal / Governance / 2003
Policy Articles / Aboriginal / Treaty Rights
Policy Articles / Aboriginal / Treaty Rights / 2003
This is the template global that I am currently using:
----------------------code------------------------
sub {
my $tags = shift;
my $seen;
my $id = $tags->{'ID'};
my $db = $DB->table ('Category','CatLinks');
my $sth = $db->select ( { LinkID => $id }, ['Name','Full_Name'] );
my $cat;
while (my ($name,$full_name) = $sth->fetchrow_array) {
if ($seen->{$name}) { next; }
$full_name =~ s/ /_/g;
$full_name =~ s/&/_/g;
$full_name =~ s/,/_/g;
$cat .= qq~<a href="$CFG->{build_root_url}/$full_name/index.html">$name</a><br>~;
$seen->{$name} = 1;
}
return $cat;
}
----------------------code------------------------
Any ideas on how i could change the Global Template to output like the example above? Is there already a template global or plugin that accomplishes this?
http://www.policy.ca/...ry/Detailed/833.html
look down and at the "Subjects / Category:" field in the table. I like the way this works, but I would like to refine the result so that it presents that output like this,
Policy Articles / Aboriginal
Policy Articles / Aboriginal / Governance
Policy Articles / Aboriginal / Governance / 2003
Policy Articles / Aboriginal / Treaty Rights
Policy Articles / Aboriginal / Treaty Rights / 2003
This is the template global that I am currently using:
----------------------code------------------------
sub {
my $tags = shift;
my $seen;
my $id = $tags->{'ID'};
my $db = $DB->table ('Category','CatLinks');
my $sth = $db->select ( { LinkID => $id }, ['Name','Full_Name'] );
my $cat;
while (my ($name,$full_name) = $sth->fetchrow_array) {
if ($seen->{$name}) { next; }
$full_name =~ s/ /_/g;
$full_name =~ s/&/_/g;
$full_name =~ s/,/_/g;
$cat .= qq~<a href="$CFG->{build_root_url}/$full_name/index.html">$name</a><br>~;
$seen->{$name} = 1;
}
return $cat;
}
----------------------code------------------------
Any ideas on how i could change the Global Template to output like the example above? Is there already a template global or plugin that accomplishes this?