Hi,
I am a beginner in using Templates.
I need help on using wrappers to develop web interface for an application
using Catalyst.
I have 2 main templates named as.
1. First_page.tt2 (index page)
2. Second_page.tt2 (A layout page with one iframe displaying the specific
page(say Funct1.tt2) based on user option )
and several Function specific templates named as 'Funct1.tt2' i have 10 more
such templates (say Funct2.tt2, Funct3.tt2...Funct10.tt2) which has to be
displayed within iframe of 'Second_page.tt2'. based on user option.
My Problem:
Currently i am using multiple template 'Second_page.tt2' with different
names, each are used to call 'Function specific templates' in respective
iframe.Since First_page.tt2 is not getting displayed from the
Second_page.tt2 iframe, i want to override the wrapper when First_page.tt2
is invoked.
My aim:
I want to use the same layout page 'Second_page.tt2' for my all 'Function
specific templates' rather then generating several layout page with
different name for each of my 'Function specific templates'.
After going through the tutorials i decided to use "Wrapper directive" .
But i am not very sure how to use it for my purpose .
I want to display 'First_page.tt2' as a index page or say login page after
user gives the credential the layout page should dispaly with a 'welcome
template' displayed through iframe of 'First_page.tt2'
My approach:
1. In my view config file (tt.pm) i have set the wrapper name as
*WRAPPER => '*Second_page.tt2***',*
2. In my First page.tt2 i have use the statement
*[%- META no_wrapper = 1 -%]
[% PROCESS header %]
<title>'First page'</title>*
.
.
.
.
3. My Second_page.tt2 start as
*[% IF no_wrapper;
debug ("Passing page through as text : $template.name");
content;
ELSE;
wrapper = wrapper || 'my_app/*Second_page.tt2*' ;
debug ("Applying wrapper $wrapper to $template.name");
content WRAPPER $wrapper;
END;
-%] *<!------I doubt if i should write the above code in the separate
wrapper page as say 'wrapper.tt2 and set that in to view config file"
*[% PROCESS header %]*
<!--TABLE - ROW 2 -->
<tr>
<td width="17%" height="4%" align="left" valign="middle"
bgcolor="#8FAFBA" id="img_form">
[% PROCESS menu1 %]
.
.
.
..........
After doing all this i can see the display error as
(First_page.tt2+Second_page.tt2+First_page.tt2) but cant navigate to
Second_page.tt2.i am not sure where i am doing the mistake.
I will greatly appreciate the effort to resolve this issue.
Thanks,
Regards,
Brajendra
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates