You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Charles N. Harvey III" <ch...@alloy.com> on 2002/01/25 00:18:53 UTC
VM_global_library.vm
Hello.
I thought this would be trivial (and I am sure it is) but I don't seem
to be able to figure it out.
I am using a url resource loader like so for my templates:
url.resource.loader.root = file:///c:/localhost/htdocs
So that I can keep my templates in a "web" directory, nowhere near the
servlets. Pretty basic stuff here.
What I am having trouble with is the global macros library.
This is what the documentation has:
velocimacro.library = VM_global_library.vm
And that is great. But it means I have to put that file in
/myapp/VM_global_library.vm. I would like to put it in the "web"
directory with all the other templates so that designers can make
changes to the global macros. I have been trying all kinds of
configurations in the velocity.properties file to get it to read
from the directory where my templates are but I can't seem to get it.
If anybody could give me a hand with this I would be greatful.
Thanks.
Charlie
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: VM_global_library.vm
Posted by "Charles N. Harvey III" <ch...@alloy.com>.
> > > Hello.
> > > I thought this would be trivial (and I am sure it is) but I don't seem
> > > to be able to figure it out.
> > >
> > > I am using a url resource loader like so for my templates:
> > > url.resource.loader.root = file:///c:/localhost/htdocs
> >
> > Is that the one from contrib?
>
> That is the one you wrote a while ago when I asked for URL loader and left
it in
> whiteboard/gier....
>
> > > /myapp/VM_global_library.vm. I would like to put it in the "web"
> > > directory with all the other templates so that designers can make
> > > changes to the global macros. I have been trying all kinds of
> > > configurations in the velocity.properties file to get it to read
> > > from the directory where my templates are but I can't seem to get it.
> >
> > Weird. That should work like any other template. The resource loader
is
> > set-up and ready before any VM system initialization. I am surprised
you
> > can't drop it into htdocs/
>
> This is indeed wierd, even though I don't use macros (yet) my
> understanding is that all .vm files go through the same loading process...
>
I found it pretty strange too. At first I was using #parse and #include
but I wanted to be able to send variables to my included files. Like a
channel name or colors. And the easiest way to do that is to instead use
a macro and not an #include. Works fine if I define it on the page or
on the #included page... just not when I try to put my macro in the global
file.
I will keep moving the file around but so far it only gets read from /myapp.
Thanks for the help.
Charlie
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: VM_global_library.vm
Posted by Igor Fedulov <if...@outlook.net>.
> > Hello.
> > I thought this would be trivial (and I am sure it is) but I don't seem
> > to be able to figure it out.
> >
> > I am using a url resource loader like so for my templates:
> > url.resource.loader.root = file:///c:/localhost/htdocs
>
> Is that the one from contrib?
That is the one you wrote a while ago when I asked for URL loader and left it in
whiteboard/gier....
> > /myapp/VM_global_library.vm. I would like to put it in the "web"
> > directory with all the other templates so that designers can make
> > changes to the global macros. I have been trying all kinds of
> > configurations in the velocity.properties file to get it to read
> > from the directory where my templates are but I can't seem to get it.
>
> Weird. That should work like any other template. The resource loader is
> set-up and ready before any VM system initialization. I am surprised you
> can't drop it into htdocs/
This is indeed wierd, even though I don't use macros (yet) my
understanding is that all .vm files go through the same loading process...
Best regards,
--
HTTP is a stateless protocol, and the Internet is a stateless development
environment
--
Igor Fedulov
E-mail : ifedulov@outlook.net
Work Ph: 773.775.1595
Home Ph: 773.281.8938
Cell Ph: 773.580.5935
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: VM_global_library.vm
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 1/24/02 6:18 PM, "Charles N. Harvey III" <ch...@alloy.com> wrote:
> Hello.
> I thought this would be trivial (and I am sure it is) but I don't seem
> to be able to figure it out.
>
> I am using a url resource loader like so for my templates:
> url.resource.loader.root = file:///c:/localhost/htdocs
Is that the one from contrib?
>
> So that I can keep my templates in a "web" directory, nowhere near the
> servlets. Pretty basic stuff here.
>
> What I am having trouble with is the global macros library.
> This is what the documentation has:
> velocimacro.library = VM_global_library.vm
>
> And that is great. But it means I have to put that file in
> /myapp/VM_global_library.vm. I would like to put it in the "web"
> directory with all the other templates so that designers can make
> changes to the global macros. I have been trying all kinds of
> configurations in the velocity.properties file to get it to read
> from the directory where my templates are but I can't seem to get it.
Weird. That should work like any other template. The resource loader is
set-up and ready before any VM system initialization. I am surprised you
can't drop it into htdocs/
I assume you tried that?
I'll try it with the URLResourceLoader from contrib.
>
> If anybody could give me a hand with this I would be greatful.
>
> Thanks.
>
> Charlie
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
--
Geir Magnusson Jr. geirm@optonline.net
System and Software Consulting
"Whoever would overthrow the liberty of a nation must begin by subduing the
freeness of speech." - Benjamin Franklin
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>