Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [sangiro] Category List via SSI / Global

Quote Reply
Re: [sangiro] Category List via SSI / Global In reply to
I think it would go something like:

Set up a global like this which produces a list of top-level categories (doesn't inc numbers of links but that should be solvable):

Code:
sub {
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Name');
my $sth = $cat_db->select ( { FatherID => 0}, ['Full_Name','Name'] );
my $output="";
while (my ($root_cat,$full_name) = $sth->fetchrow_array) {
my $url = $cat_db->as_url($root_cat);
$output .= qq~<a href="$CFG->{build_root_url}/$url/">$full_name</a><BR>\n~;
}
return $output;
}

Then a "simple" pagebuilder page with a template containing nothing other than the tag for that global. Set an appropriate name and path and it should output a file with only the html for your category list.

Bit of magic to put it in the right domain space and it should be eminently SSI-able into another page.
Subject Author Views Date
Thread Category List via SSI / Global sangiro 3988 Feb 26, 2004, 4:11 AM
Thread Re: [sangiro] Category List via SSI / Global
CrazyGuy 3900 Feb 26, 2004, 5:10 AM
Thread Re: [CrazyGuy] Category List via SSI / Global
sangiro 3896 Feb 26, 2004, 6:01 AM
Post Re: [sangiro] Category List via SSI / Global
CrazyGuy 3881 Feb 26, 2004, 6:14 AM
Thread Re: [sangiro] Category List via SSI / Global
eljot 3912 Feb 26, 2004, 5:10 AM
Thread Re: [eljot] Category List via SSI / Global
sangiro 3901 Feb 26, 2004, 5:57 AM
Thread Re: [sangiro] Category List via SSI / Global
afinlr 3890 Feb 26, 2004, 8:23 AM
Thread Re: [afinlr] Category List via SSI / Global
sangiro 3810 Mar 3, 2004, 12:29 PM
Thread Re: [sangiro] Category List via SSI / Global
afinlr 3828 Mar 3, 2004, 12:38 PM
Thread Re: [afinlr] Category List via SSI / Global
sangiro 3833 Mar 3, 2004, 12:46 PM
Post Re: [sangiro] Category List via SSI / Global
ajiimd 3794 Mar 10, 2004, 6:40 PM