Hi.
This is what got it going:
sub {
my $tags = shift;
my $file = $DB->table('Category')->file_info('Image', $tags->{ID}) or return "ID $tags->{ID} does not have a file attached.";
return $file->File_RelativePath();
}
However, in template
<img src="<%build_images_url%>/default<%cat_images%>" border=0>
the image url is fine as :
....../images/default/x/x-imagename.gif
if i use the regular
<img src="<%build_images_url%>/default/<%cat_images%>" border=0>
then in the image url on page (visitor side) there is an extra / like:
..../images/default//x/x-imagename.gif
though the images are properly displayed in both cases... Is it because of the leading slash being added to file_info() by default?
But Yes the images uploaded thru Admin are displayed correctly though.
Thanks for pointing me to the thread. As for speed, with static mode is what i prefer over dynamic one, that should not cause any big difference or will it? It could perhaps be made a bit faster if the height and width attributes of the image could also be defined...
Thanks
Anup
This is what got it going:
sub {
my $tags = shift;
my $file = $DB->table('Category')->file_info('Image', $tags->{ID}) or return "ID $tags->{ID} does not have a file attached.";
return $file->File_RelativePath();
}
However, in template
<img src="<%build_images_url%>/default<%cat_images%>" border=0>
the image url is fine as :
....../images/default/x/x-imagename.gif
if i use the regular
<img src="<%build_images_url%>/default/<%cat_images%>" border=0>
then in the image url on page (visitor side) there is an extra / like:
..../images/default//x/x-imagename.gif
though the images are properly displayed in both cases... Is it because of the leading slash being added to file_info() by default?
But Yes the images uploaded thru Admin are displayed correctly though.
Thanks for pointing me to the thread. As for speed, with static mode is what i prefer over dynamic one, that should not cause any big difference or will it? It could perhaps be made a bit faster if the height and width attributes of the image could also be defined...
Thanks
Anup