A bit of progress on this front... this global does (almost) what I need:
my $output;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Name');
my $sth = $cat_db->select ({Has_New_Links => 'Yes'} );
while (my $cat = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('newcategory', $cat);
}
return $output;
} Example
I've created a new template, newcategory, that uses <%Full_Name%> and <%Name%>.
The problem is that Full_Name is "Full Name" and not "Full_Name", and that the urlified tag doesn't work here. I've met this problem before, and thought the solution would be something like this:
sub {
my $output;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Name');
my $sth = $cat_db->select ({Has_New_Links => 'Yes'} );
while (my $cat = $sth->fetchrow_hashref) {
my $path = $cat_db->as_url($cat->{Full_Name});
$output .= Links::SiteHTML::display ('newcategory', $path);
}
return $output;
}
Can anyone see what is wrong here? (I can't)
Another question: With all the new loop-stuff in GLinks, is there an easier way to do this??
John
Code:
sub { my $output;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Name');
my $sth = $cat_db->select ({Has_New_Links => 'Yes'} );
while (my $cat = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('newcategory', $cat);
}
return $output;
}
I've created a new template, newcategory, that uses <%Full_Name%> and <%Name%>.
The problem is that Full_Name is "Full Name" and not "Full_Name", and that the urlified tag doesn't work here. I've met this problem before, and thought the solution would be something like this:
Code:
sub {
my $output;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Name');
my $sth = $cat_db->select ({Has_New_Links => 'Yes'} );
while (my $cat = $sth->fetchrow_hashref) {
my $path = $cat_db->as_url($cat->{Full_Name});
$output .= Links::SiteHTML::display ('newcategory', $path);
}
return $output;
}
Can anyone see what is wrong here? (I can't)
Another question: With all the new loop-stuff in GLinks, is there an easier way to do this??
John