search_results.html could (only) contain the following line:
Code:
<%dynamic_include($tmplname)%>
Where dynamic_include() would be the following template global:
Code:
'dynamic_include' => 'sub {
my $tpl = shift;
my $tags = GT::Template->tags;
return GT::Template->parse($tpl, $tags, { print => 0 });
}'
I use it myself to use a different template for all tables that I have. search_results.html looks like this:
Code:
<%set actionfile = generate_tmplname()%>
<%if actionfile and not details%>
<%dynamic_include($actionfile)%>
<%else%>
default search_results.html code <%endif%>
Where generate_tmplname() is the following template global:
Code:
'generate_tmplname' => 'sub {
my $tags = GT::Template->tags;
my $tmplname = @_[0] || $tags->{do};
my $filename = $tags->{admin_root_path} . "/templates/" . $tags->{template} .
"/" . ( $tags->{q} || $tags->{db} ) . "/$tmplname" . ".html";
return -e $filename ? $filename : "";
}'
good luck, Jasper
http://www.bookings.org