I don't think that's off-topic actually--one of the fundamental joys  
of Mason IMO is the component/template call structure that allows  
header and footer elements to remain in one file.  It has many  
advantages over a simple include/concatenate approach, but in  
particular there's almost never any need to have the opening tag of  
an element in a different file from the closing tag, which is the  
source of a lot of subtle bugs (and many if not most non-valid pages  
on the web).  I'd suggest trying an autohandler like the following:

<HTML>
     <HEAD>
         <& head_header &> <!-- anything from the old header that  
lives in HEAD -->
     </HEAD>
     <BODY>
         <& body_header &> <!-- anything from the old header that  
lives in BODY -->
% $m->call_next;
         <& footer &> <!-- old footer minus the closing /BODY and / 
HTML tags -->
     </BODY>
</HTML>

Each of these components will be simpler and easier to maintain/ 
extend/reuse, e.g. if you want to wrap the whole body in a new DIV  
you simply add the start and end tags in the obvious place in the  
autohandler, you don't have to touch the header or footer.

On Sep 6, 2006, at 9:50 AM, John Williams wrote:

> You could write
>
>    <& header, title=>$m->scomp('SELF:title') &>
>
> but it would be easier to just do this in the header comp:
>
>    <HTML>
>    <HEAD>
>    <TITLE><& REQUEST:title &></TITLE>
>    </HEAD>
>
> Off-topic: A less PHP-ish style would be to move the header and footer
> components into the autohandler, but there are valid reasons to do  
> it that
> way too.
>
> ~ John Williams
>
>
> On Wed, 6 Sep 2006, Tod Hagan wrote:
>
>> Hello list,
>>
>> I'm a brand new HTML::Mason user with an autohandler that looks like:
>>
>>         <HTML>
>>         <HEAD>
>>         <TITLE><& SELF:title &></TITLE>
>>         <& header &>
>>         <% $m->call_next %>
>>         <& footer &>
>>
>> I'd like to put the first three lines of HTML into my header  
>> component
>> along with the rest of the HTML and pass the title in as an argument,
>> but I can't figure out how to pass the result of SELF:title. I've  
>> tried
>> things like
>>
>>         <& header, title=>SELF:title &>
>>         <& header, title=>'SELF:title' &>
>>
>> to no avail. The first generates an error, while the second passes  
>> the
>> string 'SELF:title'.
>>
>> How can I add the value of SELF:title into the argument list I'm  
>> passing
>> to my header component?
>>
>> Thanks in advance.
>>
>>
>
>
> ---------------------------------------------------------------------- 
> ---
> Using Tomcat but need to do more? Need to support web services,  
> security?
> Get stuff done quickly with pre-integrated technology to make your  
> job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache  
> Geronimo
> http://sel.as-us.falkag.net/sel? 
> cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Mason-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mason-users


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to