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

Passing LIMIT to a global from a tag

Quote Reply
Passing LIMIT to a global from a tag
Heya all,

I'm using the global below to generate a list of the 8 latest links.

Code:
sub {
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY Add_Date DESC Limit 8');
$sth = $search_db->select ( { isNew => 'Yes', isValidated => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
if (length $link->{Title} > 50) {
$link->{Title} = substr($link->{Title}, 0, 50) . '...';
}
$output .= Links::SiteHTML::display ('link1', $link);
}
return $output;
}

I simply call this with a tag: <%global_name%>

I'd like to use this same global on other pages but generate a different number of links, say 2 or 35. How can I pass the value of "limit" to the global from the tag?

Safe swoops
Sangiro
Subject Author Views Date
Thread Passing LIMIT to a global from a tag sangiro 4393 May 15, 2004, 7:50 AM
Thread Re: [sangiro] Passing LIMIT to a global from a tag
Andy 4310 May 15, 2004, 8:03 AM
Thread Re: [Andy] Passing LIMIT to a global from a tag
sangiro 4264 May 15, 2004, 10:02 AM
Thread Re: [sangiro] Passing LIMIT to a global from a tag
afinlr 4272 May 15, 2004, 12:16 PM
Thread Re: [afinlr] Passing LIMIT to a global from a tag
sangiro 4244 May 15, 2004, 5:12 PM
Thread Re: [sangiro] Passing LIMIT to a global from a tag
Andy 4289 May 16, 2004, 2:31 AM
Thread Re: [Andy] Passing LIMIT to a global from a tag
sangiro 4242 May 16, 2004, 12:39 PM
Thread Re: [sangiro] Passing LIMIT to a global from a tag
Andy 4260 May 17, 2004, 1:22 AM
Thread Re: [Andy] Passing LIMIT to a global from a tag
sangiro 4208 May 18, 2004, 8:19 AM
Thread Re: [sangiro] Passing LIMIT to a global from a tag
Andy 4218 May 18, 2004, 8:24 AM
Thread Re: [Andy] Passing LIMIT to a global from a tag
sangiro 4216 May 18, 2004, 8:37 AM
Post Re: [sangiro] Passing LIMIT to a global from a tag
Andy 4224 May 18, 2004, 8:42 AM