Gossamer Forum
Quote Reply
Category list issue
This is really a basic question about PageBuilder and printing category lists ...

I want to create a new OPML-file, which is an XML-file looking like this:

Code:
...
<outline text="Services">
<outline text="Google API">
<outline text="Implementations">
</outline>
<outline text="Applications">
</outline>
</outline>
<outline text="xmlStorageSystem">
<outline text="Implementations">
</outline>
</outline>
</outline>
...



Here, "Services" would be a toplevel category, with "Google API" and "xmlStorageSystem" would be sub-categories (and "Implementations" the name of two sub-sub-categories, etc.).
But with some somewhat complex nesting within tags...

Can anyone help me here?

I can make the "flat" lists, like these...

Get and print main categories:

Code:
sub {
my $tags = shift;
my $cat_db = $DB->table('Category');
my @root_cats = $cat_db->select (['Full_Name'], { FatherID => 0 })->fetchall_list;
my $output;
foreach my $root_cat (@root_cats) {
my $url = $cat_db->as_url($root_cat);
my $id = $cat_db->as_id($root_cat);
$output .= qq~<outline text="$root_cat" type="link" url="$CFG->{build_root_url}/$url" />\n~;
}
return $output;
}


Get and print all categories:

Code:
sub {
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options("ORDER BY Full_Name");
my @root_cats = $cat_db->select (['Full_Name'])->fetchall_list;
my $output;
foreach my $root_cat (@root_cats) {
my $url = $cat_db->as_url($root_cat);
$output .= qq~<outline text="$root_cat" type="link" url="$CFG->{build_root_url}/$url" />\n~;
}
return $output;
}


But how to make the nested lists??

Last edited by:

gotze: Apr 16, 2003, 12:18 PM
Subject Author Views Date
Thread Category list issue gotze 3976 Apr 16, 2003, 12:17 PM
Thread Re: [gotze] Category list issue
klauslovgreen 3905 Apr 16, 2003, 12:51 PM
Thread Re: [klauslovgreen] Category list issue
afinlr 3877 Apr 16, 2003, 4:34 PM
Thread Re: [afinlr] Category list issue
klauslovgreen 3843 Apr 17, 2003, 1:05 AM
Post Re: [klauslovgreen] Category list issue
gotze 3861 Apr 17, 2003, 3:44 AM
Thread Re: [gotze] Category list issue
afinlr 3842 Apr 17, 2003, 4:09 AM
Thread Re: [afinlr] Category list issue
gotze 3838 Apr 17, 2003, 4:40 AM
Thread Re: [gotze] Category list issue
afinlr 3835 Apr 17, 2003, 5:23 AM
Thread Re: [afinlr] Category list issue
gotze 3864 Apr 17, 2003, 6:16 AM
Thread Re: [gotze] Category list issue
webmaster33 3810 Apr 20, 2003, 8:58 AM
Thread Re: [webmaster33] Category list issue
gotze 3817 Apr 20, 2003, 9:03 AM
Post Re: [gotze] Category list issue
webmaster33 3809 Apr 20, 2003, 9:19 AM