Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Detecting category from link.html

Quote Reply
Detecting category from link.html
Hi,

Im displaying selected links on the sites homepage (home.html) using the following sub:

sub {
my ($sth,$link);
my $db = $DB->table ('Links') || return $GT::SQL::error;
$db->select_options ('ORDER BY PriceSavingPercent DESC', 'LIMIT 1') || return $GT::SQL::error;
my $cond = GT::SQL::Condition->new('isValidated', '=', 'Yes', 'Rating', '>', '4', 'OurPrice', '<', '20.00') || return $GT::SQL::error;
my $sth = $db->select ($cond) || return $GT::SQL::error;
my $output =qq~<tr>\n<td colspan="2"><p><strong>Todays Discounts - Upto \$19.99</strong></p></td>\n</tr>~;
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $link) || return $GT::SQL::error;
}
return $output;
}

example: www.coffee-maker-store.com

Im hoping to be able to modify the way these display by dropping the Availability and Rating info for each.

As far as I can tell the simplest way to do this would be to detect the category_id (0 for home.html) within the link.html template using conditionals.

i.e. if (category_id eq "0") {
# do some thing here
}

How would I go about adding category_id so it can be detected from link.html ? or would you suggest I hardcode each link within the sub itself and not use the Links::SiteHTML::display method?

thanks for your help,

Charlie

Last edited by:

Chas-a: Mar 9, 2004, 9:19 AM
Subject Author Views Date
Thread Detecting category from link.html Chas-a 997 Mar 9, 2004, 9:18 AM
Thread Re: [Chas-a] Detecting category from link.html
afinlr 931 Mar 9, 2004, 12:25 PM
Post Re: [afinlr] Detecting category from link.html
Chas-a 922 Mar 9, 2004, 2:05 PM