[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mason
Subject:    Re: [Mason] Dynamic titles from methods
From:       "P. Fleury" <fleury () users ! sourceforge ! net>
Date:       2004-04-07 23:14:01
Message-ID: 40748B39.2010708 () users ! sourceforge ! net
[Download RAW message or body]



C. Stephen Gunn wrote:

>Jim (jim@greenboots.org) likely uttered:
>  
>

>I wrote some common code to do this by inspecting attributes in the
>current request's autohandler callchain, it's fairly gross, but it works
>well for my purposes.
>
>  
>
I did something similar, to aggregate keywords for the keywords <meta> 
in the page <head>. The keywords are comma-separated texts, like
<%attr>
    keywords => 'personal site, gallery'
</%attr>

This code is in the root-level autohandler, and the result is a list of 
texts from all the components of the call-chain.

% my $comp = $m->request_comp;
% my %seen; my @kwds;
% while ( $comp ) {
%   push(@kwds, grep { ! $seen{$_}++ } split(/\s*,\s*/, 
$comp->attr_if_exists('keywords')) );
%   $comp = $comp->parent;
% }

--Pascal


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic