Hi assombracao,
Thanks to the sub you posted, I've managed to crack this one
Instead of using the ID in the template, call it from the existing tags, e.g.;
sub {
my $tags = GT::Template->tags;
my $id = $tags->{ID};
my ($table, $image_col) = @_;
my $file = $DB->table($table)->file_info($image_col, $id) or return "ID
$id does not have a file attached.";
return $file->File_RelativePath();
}
Then, call the sub from the template without the ID, e.g.;
<%picpath('table_name','image_column_name')%>
Hope this helps others too!
All the best
Shaun
Thanks to the sub you posted, I've managed to crack this one
Instead of using the ID in the template, call it from the existing tags, e.g.;
Quote:
sub {
my $tags = GT::Template->tags;
my $id = $tags->{ID};
my ($table, $image_col) = @_;
my $file = $DB->table($table)->file_info($image_col, $id) or return "ID
$id does not have a file attached.";
return $file->File_RelativePath();
}
Then, call the sub from the template without the ID, e.g.;
Quote:
<%picpath('table_name','image_column_name')%>
Hope this helps others too!
All the best
Shaun