I have not given up. I have made some progress, but really would appreciate some help
Issue 1: Active Tags
I am still struggling with the linkability issue.
This code:
my $output;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Full_Name');
my $sth = $cat_db->select ({Has_New_Links => 'Yes'} );
while (my $cat = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('newcategory', $cat);
}
return $output;
}is fine except it doesn't create the right urls. I've tried as_url etc, but just can't get it to work.
This code, however:
my $output;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Full_Name');
my $sth = $cat_db->select ( ['Full_Name','Name'], { Has_New_Links => 'Yes' });
while (my ($cat,$name) = $sth->fetchrow_array) {
$cat =~ s/ /_/g;
my $cat1 = $cat;
$output .=qq~<a href="$CFG->{build_root_url}/$cat1">$name</a>, ~;
}
return $output;
}works, but uses a cheap trick to create the right urls. I don't like having to hardcode the HTML.
So, why can't I get it to work with the template?
Issue 2: Technorati Tags-style
It is important to me to be able to style the output. Here is stuff I want to do:
<big>
<a href="/links/<%Full_Name%>"><%Name%></a>
</big>
<%else%>
<a href="/links/<%Full_Name%>"><%Name%></a>
<%endif%>
This can be used to present something like this (here: all categories, categories with more than 50 links or with new links have bigger font)
Now I just need to combine these two.
I'll promise to write up a reusable global and stuff if I get help getting it to work.
John
Issue 1: Active Tags
I am still struggling with the linkability issue.
This code:
Code:
sub { my $output;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Full_Name');
my $sth = $cat_db->select ({Has_New_Links => 'Yes'} );
while (my $cat = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('newcategory', $cat);
}
return $output;
}
This code, however:
Code:
sub { my $output;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Full_Name');
my $sth = $cat_db->select ( ['Full_Name','Name'], { Has_New_Links => 'Yes' });
while (my ($cat,$name) = $sth->fetchrow_array) {
$cat =~ s/ /_/g;
my $cat1 = $cat;
$output .=qq~<a href="$CFG->{build_root_url}/$cat1">$name</a>, ~;
}
return $output;
}
So, why can't I get it to work with the template?
Issue 2: Technorati Tags-style
It is important to me to be able to style the output. Here is stuff I want to do:
Code:
<%if Number_of_Links > 50 or Has_New_Links eq Yes%> <big>
<a href="/links/<%Full_Name%>"><%Name%></a>
</big>
<%else%>
<a href="/links/<%Full_Name%>"><%Name%></a>
<%endif%>
This can be used to present something like this (here: all categories, categories with more than 50 links or with new links have bigger font)
Now I just need to combine these two.
I'll promise to write up a reusable global and stuff if I get help getting it to work.
John