Hi there,
I am setting up a global to display links on the home page. I found this in the forum which works great EXCEPT I am using detailed pages for some of my links and this global does not recognise this tag (Unknown Tag: 'detailed_url')
what do I need to add/change to do this? FYI... I am fairly new to this so I do not fully understand whats going on in the sub...
Sub: latest_links
sub {
my ($cat_id,$all_ids,@list,$output,$link_db,$condition);
$cat_id = shift;
$all_ids = $DB->table('Category')->children($cat_id);
push @$all_ids, $cat_id;
$link_db = $DB->table('Links','CatLinks','Category');
$link_db->select_options ("ORDER BY Add_Date DESC LIMIT 5");
$condition = GT::SQL::Condition->new( 'isValidated','=','Yes','isNew','=','Yes','CategoryID', 'IN', \@$all_ids);
my $sth = $link_db->select($condition);
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link_homenew', $link);
}
return $output;
}
Called on page using: <%latest_links('76')%>
76 - is the category to show new links from
Many thanks
I am setting up a global to display links on the home page. I found this in the forum which works great EXCEPT I am using detailed pages for some of my links and this global does not recognise this tag (Unknown Tag: 'detailed_url')
what do I need to add/change to do this? FYI... I am fairly new to this so I do not fully understand whats going on in the sub...
Sub: latest_links
sub {
my ($cat_id,$all_ids,@list,$output,$link_db,$condition);
$cat_id = shift;
$all_ids = $DB->table('Category')->children($cat_id);
push @$all_ids, $cat_id;
$link_db = $DB->table('Links','CatLinks','Category');
$link_db->select_options ("ORDER BY Add_Date DESC LIMIT 5");
$condition = GT::SQL::Condition->new( 'isValidated','=','Yes','isNew','=','Yes','CategoryID', 'IN', \@$all_ids);
my $sth = $link_db->select($condition);
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link_homenew', $link);
}
return $output;
}
Called on page using: <%latest_links('76')%>
76 - is the category to show new links from
Many thanks