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
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