velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai <shinobu.ka...@gmail.com>
Subject Re: Global Context
Date Fri, 10 Dec 2004 11:55:25 GMT
Hi Shawn,

> Is there a way to set a global context. I using tiles with velocity and I can't pass
a variable into all my vm files.

Setting the variable in the Context (e.g. via an attribute in the
request) should make it available for all the templates.  Or are you
trying to do something else?

Just to make things clear, where/how do you want to set the variables,
and where/how do you want to use it?

> <!DO TYPE tiles-definitions PUBLIC
>       "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
>       "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
> 
> <tiles-definitions>
> 
>    <definition name=".site" path="/templates/master.vm">
>        <put name="title" value="One" />
>        <put name="head" value="/templates/comps/header.vm" />
>        <put name="left" value="/templates/comps/left_nav.vm" />
>        <put name="footer" value="/templates/comps/footer.vm" />
>    </definition>
> 
>    <definition name="home.page" extends=".site">
>                <put name="body" value="/templates/pages/home.vm" />
>    </definition>
> 
> </tiles-definitions>

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <shinobu.kawai@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message