Nice guess Randal!

Indeed page.title get set from template.title as follows:

config/page:
-----------

[%-  USE Date;
    # define page data structure
    page = {
        file     = template.name
        title    = template.title
        about    = template.about
        type     = template.type or 'html'
        date     = template.date or Date.format(template.modtime)
    };
-%]

    title = '[% title %]'
    about = '[% about %]'

Resulting in:

title = ''
about = ''

So something is definitely going wrong hear -- scratch my (balding) head.

$tt->process('main.html.tmpl', $vars)
    || die $tt->error();

src/main.html.tmpl:
------------------

[%
    IF session.logged_in;
        tmpl_file = q.param('page') or 'index';
    ELSE;
        tmpl_file = 'login';
        CALL q.param( 'page', 'login' );
    END
%]

[% PROCESS "${tmpl_file}.html.tmpl" %]

But this is weird, because META is defined as follows.

src/login.html.tmpl:
-------------------
[% META title = 'Login Page'
        about = 'Description about the login page' %]


So why's it still printed blank?!

-- 
Kiffin Rex Gish
Gouda, The Netherlands

 



> -----Original Message-----
> From: Randal L. Schwartz [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, October 25, 2005 14:22
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]; [email protected]
> Subject: Re: [Templates] Submerged META via PROCESS ...
> 
> 
> >>>>> "Kiffin" == Kiffin Gish <[EMAIL PROTECTED]> writes:
> 
> Kiffin> Randal, I believe you are referring to page.title in file 
> Kiffin> 'site/html' and page.about in file 'site/header'.
> 
> yes, and that's an important detail that you left out.
> 
> Kiffin>   <title>[% page.title %]</title>
> 
> OK, who sets page.title?  Where does that get set?  I'm 
> betting it gets set from template.title.  Or maybe page gets 
> set to template?
> 
> This is a programming problem.  Please follow the data flow 
> from template.title to that line above, and figure out where 
> you can also add global.title_override or something.
> 
> -- 
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - 
> +1 503 777 0095 <[email protected]> 
> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, 
> etc. etc. See PerlTraining.Stonehenge.com for onsite and 
> open-enrollment Perl training!
> 


_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to