Gossamer Forum
Home : Products : Others : Gossamer Community :

Printing a template... but it can't find it?

Quote Reply
Printing a template... but it can't find it?
I'm finally getting to have a play with GComm :)

I have;

return GT::Template->parse('contact.html');

I'm including GT::Template further up).

However, I get an error;

The system encountered a fatal error:
GT::Template::Parser (25318): Unable to locate template file 'contact.html' in '.' or any inheritance directories at GT::Template::_compile_template line 669.

Anyone got any ideas? I know for a fact that contact.html exists ... but it doesn't seem to be acknowledging it?

TIA

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Printing a template... but it can't find it? In reply to
I finally managed to get it working, by specifying the full file path :P

The code is;

Code:
print $IN->header();
my $file = $CFG->{path_private}.'/templates/default' . '/contact.html';
print GT::Template->parse($file);
exit;

However, I would have expected it to work like;

Code:
my $file = $CFG->{path_private}.'/templates/default' . '/contact.html';
return GT::Template->parse($file);
exit;

...am I being stupid?

TIA

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!