Ok, here's something that works to show more than one category, but it's not in a breadcrumb format - just each final category:
require Links::Build;
my $id = shift;
my $cat_db = $DB->table('Category');
my $catlink = $DB->table('CatLinks','Category');
$catlink->select_options ('ORDER BY Full_Name ASC');
my @names = $catlink->select ({ LinkID => $id }, ['Full_Name'])->fetchall_list;
my @link_cats;
for (@names) {
push @link_cats, { cat_name => Links::Build::build ('title_unlinked',$_), cat_url => $cat_db->as_url($_)};
}
return { link_cats => \@link_cats };
}This is called on the page by:
<%loop link_cats%>
<a href="<%build_root_url%>/<%cat_url%>"><%cat_name%><br>
<%endloop%>
Any way to adapt this to show the breadcrumb format and multiple category links?
Thanks
Rich
Code:
sub { require Links::Build;
my $id = shift;
my $cat_db = $DB->table('Category');
my $catlink = $DB->table('CatLinks','Category');
$catlink->select_options ('ORDER BY Full_Name ASC');
my @names = $catlink->select ({ LinkID => $id }, ['Full_Name'])->fetchall_list;
my @link_cats;
for (@names) {
push @link_cats, { cat_name => Links::Build::build ('title_unlinked',$_), cat_url => $cat_db->as_url($_)};
}
return { link_cats => \@link_cats };
}
Code:
<%get_link_cats($ID)%> <%loop link_cats%>
<a href="<%build_root_url%>/<%cat_url%>"><%cat_name%><br>
<%endloop%>
Any way to adapt this to show the breadcrumb format and multiple category links?
Thanks
Rich