Claude said:
...
> What if some screens want to specify a part of the header, and what if
this part, might it be a javascript section for instance,
> cannot be specified using a #set directive ?
...
> but in the screen template itself, I'm restricted to the #set directive
and cannot do sthing like :
>
> #header()
> <javascript>
> ...
> </javascript>
> #end

hmm.  actually, in 1.4-dev, you could pull this off with a #set directive.
i'm pretty sure Geir add support for things like this:

#set( $header =
"<javascript>
...
</javascript>
" )

it was something requested during the last annual whitespace debate.  of
course, 1.4 isn't released yet, but it should be someday... :-/

alternatively, you could pawn your javascript header (and whatever else you
want) off to separate "navigation" (Turbine-speak) or "tile" (Struts-speak)
templates.  then you could do #set( $header = "headers/MyJavascript.vm" ) in
your screen template, and in your layout template do:

...
<head>
<title>$page_title</title>
#if( $header )
#parse( $header )
#end
</head>
...

this is generally how i am handling these sorta things lately.

> So I was wondering if someone had already encountered the need of a set
directive for blocks, sthing like :
>
> #block_set($screen_header)
> <javascript>
> ...
> </javascript>
>
> #end
>
> It would solve my problem.

That's something of a syntax-change (setting $screen_header instead of using
it as a param), but Velocity does support plugging in your own directives.
So, while i'm not aware of anything like this being around, you could always
try to write it yourself.

Nathan Bubna
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to