Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [assombracao] Hardcode image URL into template?

Quote Reply
Re: [assombracao] Hardcode image URL into template? In reply to
Hi assombracao,

Thanks to the sub you posted, I've managed to crack this one Smile

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
Subject Author Views Date
Thread Hardcode image URL into template? qango 6833 Mar 17, 2005, 8:41 AM
Thread Re: [qango] Hardcode image URL into template?
assombracao 6630 Apr 24, 2005, 4:50 PM
Thread Re: [assombracao] Hardcode image URL into template?
qango 6592 May 4, 2005, 4:24 AM
Thread Re: [qango] Hardcode image URL into template?
assombracao 6550 Jun 21, 2005, 6:14 PM
Thread Re: [assombracao] Hardcode image URL into template?
assombracao 6482 Aug 23, 2005, 9:59 AM
Thread Re: [assombracao] Hardcode image URL into template?
assombracao 6488 Aug 25, 2005, 4:12 AM
Post Post deleted by qango
qango 6408 Oct 12, 2005, 8:45 AM
Post Re: [assombracao] Hardcode image URL into template?
qango 6405 Oct 12, 2005, 8:50 AM
Thread Re: [qango] Hardcode image URL into template?
mick31 6400 Oct 26, 2005, 5:02 AM
Post Re: [mick31] Hardcode image URL into template?
qango 6245 Jan 4, 2006, 4:04 AM