Gossamer Forum
Home : Gossamer Threads Inc. : Discussion :

Re: [Andy] include a filename which is stored in a variable

Quote Reply
Re: [Andy] include a filename which is stored in a variable In reply to
What am I doing wrong?

GLOBAL "dynamic_include":

sub {
# This is so we can include a detail page template
# dynamically based on Detail_Template col in Links table
# usage: <%dynamic_include($Detail_Template)%>

my $veitpl = shift;
my $veitags = GT::Template->tags;
return GT::Template->parse($veitpl, $veitags, { print => 0 } );


CODE FROM the TEMPLATE FILE:

<%if Detail_Template%>
<%dynamic_include($Detail_Template)%>
<%else%>
<%include detailed_std.html%>
<%endif%>

BUILD SAYS:

A fatal error has occured:
GT::Template::Parser (1544): Unable to locate template file 'detailed_std.html' in '.' or any inheritance directories at GT::Template::_compile_template line 627.


Please enable debugging in setup for more details.


Stack Trace======================================Links (1544): Links::environment called at /cgibin/admin/Links.pm line 431 with no arguments.Links (1544): Links::fatal called at GT::Base::error line 362 with arguments (GT::Template::Parser (1544): Unable to locate template file 'detailed_std.html' in '.' or any inheritance directories at GT::Template::_compile_template line 627. ).Links (1544): GT::Base::error called at /cgibin/admin/GT/Template/Parser.pm line 99 with arguments (GT::Template::Parser=HASH(0xa960058), CANTFIND, FATAL, detailed_std.html, .).Links (1544): GT::Template::Parser::parse called at GT::Template::_compile_template line 627 with arguments (GT::Template::Parser=HASH(0xa960058), detailed_std.html, HASH(0xa9235c4), [undef]).Links (1544): GT::Template::_compile_template called at /cgibin/admin/GT/Template.pm line 454 with arguments (GT::Template=HASH(0xa9752fc), detailed_std.html, ./compiled/detailed_std.html.compiled, [undef]).Links (1544): GT::Template::load_template called at /cgibin/admin/GT/Template.pm line 93 with arguments (GT::Template=HASH(0xa9752fc), detailed_std.html, [undef]).It

Build complains that it can't find 'detailed_std.html', yet it is there and the debug show that it compiled it. However, there is no compiled file in the /compiled directory. When I do a normal <%include detailed_std.html%>, it works fine. I'm lost...
Subject Author Views Date
Thread include a filename which is stored in a variable jaspercram 15149 Nov 15, 2002, 3:05 AM
Thread Re: [jaspercram] include a filename which is stored in a variable
yogi 14978 Nov 15, 2002, 3:18 AM
Post Re: [yogi] include a filename which is stored in a variable
jaspercram 14858 Nov 15, 2002, 3:25 AM
Post Re: [jaspercram] include a filename which is stored in a variable
Paul 14870 Nov 15, 2002, 4:23 AM
Thread Re: [jaspercram] include a filename which is stored in a variable
jaspercram 14860 Nov 15, 2002, 5:18 AM
Thread Re: [jaspercram] include a filename which is stored in a variable
Alex 14859 Nov 15, 2002, 10:38 AM
Thread Re: [Alex] include a filename which is stored in a variable
jaspercram 14827 Nov 18, 2002, 12:25 AM
Thread Re: [jaspercram] include a filename which is stored in a variable
carfac 14772 Nov 21, 2002, 10:46 AM
Thread Re: [carfac] include a filename which is stored in a variable
jaspercram 14747 Nov 21, 2002, 1:16 PM
Post Re: [jaspercram] include a filename which is stored in a variable
carfac 14692 Nov 21, 2002, 1:38 PM
Thread Re: [Alex] include a filename which is stored in a variable
Peter544 14477 May 17, 2003, 4:49 PM
Thread Re: [Peter544] include a filename which is stored in a variable
yogi 14401 May 17, 2003, 11:24 PM
Post Post deleted by Peter544
Peter544 14287 May 18, 2003, 5:37 PM
Thread Re: [yogi] include a filename which is stored in a variable
Peter544 14412 May 19, 2003, 9:47 PM
Thread Re: [Peter544] include a filename which is stored in a variable
Andy 14350 May 20, 2003, 1:25 AM
Thread Re: [Andy] include a filename which is stored in a variable
vicos2 14135 Jun 28, 2003, 6:46 PM
Thread Re: [vicos2] include a filename which is stored in a variable
Alex 14181 Jun 30, 2003, 11:44 AM
Post Re: [Alex] include a filename which is stored in a variable
jai 13299 Feb 28, 2006, 11:25 PM